techmanbd Posted September 24, 2003 Posted September 24, 2003 What I am trying to do is when I click a button, it pops up another form to add info, and at the same time i disable the main form. Now when I exit the info form i want to re-enable the form. I don't want to us the dim frmnew as new frmmain and the .show because that just pops up a new form. I want to keep the existing form in tact Main form code: Private Sub cmdAddname_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdAddname.Click Dim frmName As New frmNames frmName.Show() Me.Enabled = False End Sub frmName code on exit: Private Sub cmdExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdExit.Click frmMain.Enabled = True Me.Close() End Sub Quote Live as if you were to die tomorrow. Learn as if you were to live forever. Gandhi
pendragon Posted September 24, 2003 Posted September 24, 2003 You could pass a ref for the form to your now one and then re-enable it when you quit or use frmName.ShowDialog, this will disable the first form untill you close the new form Quote
techmanbd Posted September 24, 2003 Author Posted September 24, 2003 perfect, Thanks. .showdialog was exactly what i was looking for Quote Live as if you were to die tomorrow. Learn as if you were to live forever. Gandhi
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.