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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Newbie in VB.NET (vb6 programmer who made switch)

Status
Not open for further replies.

stx

Programmer
Sep 24, 2002
62
BE
Hi

In vb6 i had a multiple document interface. When a menuitem in the parentform was clicked the according childform was displayed. At that time i also disabled that menuitem of the parent so no other instance of the childform could be opened. When the childform is unloaded i re-enabled the menuitem of the parent.

In vb.net i don't know how to re-enable the menuitem of the parent when my childform is unloaded.

Can someone help me pease !
 
stx,

Look up the singleton pattern. This is what you are after.

Craig
 
Sorry

Maybe i was not clear enough.

But the only thing i want to do is to enable the menuitem from the menu on my parentform, which was disabled earlier, and this when my childform is closed.

thnx

 
When you declare the MDI form use the withevents key word

Eg.
'Class level
Dim WithEvents As FrmMyForm

now you can catpture the events of FrmMy using a normal event handler, simply select the form object and then the event you want in the nomal way to produce the skeleton event handler

Private Sub FrmMyForm_Closed(ByVal sender As Object, ByVal e As System.EventArgs) Handles FrmFind.Closed
'Enable the button
Button.enabled = True
End Sub

Regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top