navigation

plumage

Active member
Joined
Jul 12, 2004
Messages
38
Programming Experience
Beginner
i got a form got main menu.
then another form call customer.

but the thing is how cum after i close the customer form,and i go bk to the main menu and click the navigation to open the customer form, it wouldnt work.
it give me error

the code i use is: frmcustomer.show()

can anyone help me?
 
A form is a class. In order to open a form, you had to instantiate the class somewhere (using a statement similar to 'Dim frmcustomer as New FormCustomer', where FormCustomer is the name of the form).
When you close the form, it is disposed and there is no longer an instance of the form to Show.

In the MenuItem's click event handler, use code similar to this:

VB.NET:
If frmCustomer Is Nothing OrElse frmCustomer.IsDisposed Then _
    frmCustomer = New FormCustomer()
frmCustomer.Show()
 
Last edited:
Back
Top