how to access control property on MDI parent form

S

Setsuna

Hi...

i have created a MDI form and a MDI child form.
i am supposed to enable or disable certain menu in the MDI parent form based
on certain condition that occur.
is there anyway of doing it like the old VB6 ways of direct manipulation .
such as

frmMDIParent.mnuAdd.Enabled = True

if not what are the other way



If txtName.text = "T"Then
Dim frmParent As New frmMDIParent()

frmParent.mnuAdd.Enabled = True

frmParent.Show

end if


thanks

stanly
 
C

Charles Law

Hi Stanly

The common way to implement this is for your child form to raise an event
when its state changes, so that the owner - in this case the parent form -
can update its menus and toolbar buttons. The event passes two parameters,
the second of which is a class derived from EventArgs. This new class
contains enough information for the owner to determine which menus should be
active. If you want to look this up it is called the Observer pattern.

HTH

Charles
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top