473,326 Members | 2,815 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 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 2667
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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.