Disable MDI parent form button from MDI child form

Please support our VB.NET advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Dec 2007
Posts: 66
Reputation: manutd4life is an unknown quantity at this point 
Solved Threads: 1
manutd4life manutd4life is offline Offline
Junior Poster in Training

Disable MDI parent form button from MDI child form

 
0
  #1
Aug 14th, 2009
Ok i have a button on MDI parent form and i need to disable it when closing a child form. When writing the button name (cmdmenu) in the child form, it says that the cmdmenu is not declared please help
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 54
Reputation: Pgmer is an unknown quantity at this point 
Solved Threads: 5
Pgmer Pgmer is offline Offline
Junior Poster in Training

Re: Disable MDI parent form button from MDI child form

 
0
  #2
Aug 14th, 2009
Ok i have a button on MDI parent form and i need to disable it when closing a child form. When writing the button name (cmdmenu) in the child form, it says that the cmdmenu is not declared please help[/QUOTE]


That button should be publicaly decalred.
if it is publically availabele then
in child form closing event
Mdiform.cmdmenu.disabled=true
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 66
Reputation: manutd4life is an unknown quantity at this point 
Solved Threads: 1
manutd4life manutd4life is offline Offline
Junior Poster in Training

Re: Disable MDI parent form button from MDI child form

 
0
  #3
Aug 14th, 2009
how to declare a button in module
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 66
Reputation: manutd4life is an unknown quantity at this point 
Solved Threads: 1
manutd4life manutd4life is offline Offline
Junior Poster in Training

Re: Disable MDI parent form button from MDI child form

 
0
  #4
Aug 14th, 2009
Got it i solved it
Here's the code
  1. Dim par As frmMainmenu = Me.MdiParent
  2. par.cmdmenu.Enabled = False
no need to declare it in module, it works great
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC