471,349 Members | 1,173 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,349 software developers and data experts.

Access to MdiParent Controls in VB.Net

Good Day, I have a programming problem and need some help/advice. I have a
MdiParent Form that has a tool bar with icons on it. I have a child form that
needs set the toolbar enabled property to FALSE. Currently, I have the
following syntax in my main module when running the application:

Public Sub Main()

Dim frmSplash As SplashScreen
Dim frmParent As ParentForm

'Directory structure to fox table.
vfClass.mydirectory = Directory.GetCurrentDirectory & _
"\data\sysconn.dbf"

Try

(Code)....

System.Windows.Forms.Application.EnableVisualStyle s()
System.Windows.Forms.Application.DoEvents()
System.Windows.Forms.Application.Run(New SplashScreen)
System.Windows.Forms.Application.Run(New ParentForm)
End Module

As you can see the form is not a global form. In my child form I need to
disable the menu and toolbar on the ParentForm when the child form is loaded.
How can I access the menu/toolbar on the ParentForm? Any ideas?Thanks.
--
TC
Jul 21 '05 #1
2 2583
Terrance,

You show us some code, however how I don't see any relation with your
problem. Normaly can you access a mdiparent just by telling that it is the
mdiparent in the child.
Something as
Mdiparent.whatever

I hope this helps something,

Cor
Jul 21 '05 #2
Hi Terrance

This came up recently in the WindowsForms group, but my answer here is the
same:

<snip>
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.
</snip>

HTH

Charles
"Terrance" <Te******@discussions.microsoft.com> wrote in message
news:AA**********************************@microsof t.com...
Good Day, I have a programming problem and need some help/advice. I have a
MdiParent Form that has a tool bar with icons on it. I have a child form
that
needs set the toolbar enabled property to FALSE. Currently, I have the
following syntax in my main module when running the application:

Public Sub Main()

Dim frmSplash As SplashScreen
Dim frmParent As ParentForm

'Directory structure to fox table.
vfClass.mydirectory = Directory.GetCurrentDirectory & _
"\data\sysconn.dbf"

Try

(Code)....

System.Windows.Forms.Application.EnableVisualStyle s()
System.Windows.Forms.Application.DoEvents()
System.Windows.Forms.Application.Run(New SplashScreen)
System.Windows.Forms.Application.Run(New ParentForm)
End Module

As you can see the form is not a global form. In my child form I need to
disable the menu and toolbar on the ParentForm when the child form is
loaded.
How can I access the menu/toolbar on the ParentForm? Any ideas?Thanks.
--
TC

Jul 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Duncan | last post: by
2 posts views Thread by Terrance | last post: by
1 post views Thread by Lucas Graf | last post: by
2 posts views Thread by Terrance | last post: by
9 posts views Thread by Anil Gupte | last post: by
reply views Thread by =?Utf-8?B?UnVieSBOYWRsZXI=?= | last post: by
6 posts views Thread by Wesley Peace | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.