Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

hi all...

 

i have 2 form

form1 --> mdi parent

form2 ---> mdi child + button1

 

form 2 will show by clicking the menu at form 1 after that the menuitem will disable, button1 is unload form 1 and enable back the menuitem.

my probelm is how to enable back the menuitem which i have disable

 

i have try the following code at button 1 but is not working

dim form1 as new form1

form1.menuitem.enable = true

me.close

 

pls help me, im stuck:confused:

thx in advance

  • *Experts*
Posted

What you can do is cast the MdiParent property of Form2 to a type of

Form1, then access the properties of the MainMenu control. Be

sure that the access modifier for the menu controls is set to

Public, or else you won't be able to see it.

 

Dim parentForm As Form1 = DirectCast(Me.MdiParent, Form1) ' Cast the parent form type to Form1
parentForm.MainMenu.MenuItems(0).Enable = True ' Enable the menu item here (put in your own code)
Me.Close()

"Being grown up isn't half as fun as growing up

These are the best days of our lives"

-The Ataris, In This Diary

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...