472,958 Members | 2,206 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,958 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 2648
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Duncan | last post by:
Dear friends, I have a MDIform in vb.net with some images and buttons on it. This works fine unless I open a MDIChild. The child is being displayed between the images and buttons and the parent...
2
by: Terrance | last post by:
I'm hoping that there's someone out here that can help me with a coding problem. Here is the scenerio: I have a MdiParent Form on this MdiParent form there is a listview control and several text...
4
by: Vaughn | last post by:
When I pass a reference to my current form, frm_x, when I create and show another form, frm_y, do I have access to all of the public methods, controls, members, etc.. of frm_x from frm_y? In my...
1
by: Lucas Graf | last post by:
This sounds so easy to me and feel like an idiot that I can't figure it out, but....how can I have a MDI child access it's parents control(s)?? Seems like it should be as easy as making the...
2
by: Terrance | last post by:
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...
1
by: mabond | last post by:
Hi I've noticed a couple of postings on this topic. I'm either not uderstanding them or I'm missing something. My app uses an MDIParent form (frmCAD). A menu item on frmCAD shows a child form...
9
by: Anil Gupte | last post by:
I have a MDI Parent Child set of forms FormContainer --MDIParent FormStart --MDIChild FormMain-->MDIChild FormSliceInfo-->MDIChild I use the following in the beginning of FomrContainer ...
0
by: =?Utf-8?B?UnVieSBOYWRsZXI=?= | last post by:
Hi everyone, i am trying to set control on mdi form from mdi child: trying to set toolstrip on mdi parent (MDIMain) from child form doing this way on the child form: ToolStrip Tool =...
6
by: Wesley Peace | last post by:
I hate to cross post, but I've gotten no answer yet on a problem I'm having with visual studio 2008. I've created a series of forms with controls to access a Access database tables. The...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

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.