Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Confusion in CurrentForm.ShowDialog() and me.Hide()

Status
Not open for further replies.

salimwng

IS-IT--Management
Mar 11, 2002
134
0
0
MU
Hello,

I am getting more and more confused with the command me.hide() , me.close() and me.dispose() when using with CurrentForm.ShowDialog().

My problem is as follows;

I have a form (MainForm.vb) that contain 3 Buttons;

1. First one is for Adding a user name
2. Second one for Modifying the password.
3. Third one for Deleting a user name and password.

I have been able to work out each one above with successful connection to the Database at runtime.

When the first button is clicked another form is open(called AdminPass.vb) whereby the user need to enter a password to get access to Password_Util.vb form. I have used {below} in the Private Sub But...Click...;

CurrentForm = New AdminPass()
CurrentForm.ShowDialog()

End Sub

When i am in AdminPass.vb and i have successfully entered the password, i want the AdminPass.vb to close and the Password_Util.vb to open. I have used the following code;

Me.Hide()
CurrentForm = New Password_Util()
CurrentForm.Show()

It is at this point that i am having problem. The Adminpass.vb form disappear and my new form Password_Util is opened BUT WITH THE Mainform.vb also ( in other words, i can work on 2 forms ).

What must i use in my code to close the form that i am not using and have my current form ONLY ?

Thank you
Salim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top