473,796 Members | 2,595 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.mydirec tory = Directory.GetCu rrentDirectory & _
"\data\sysconn. dbf"

Try

(Code)....

System.Windows. Forms.Applicati on.EnableVisual Styles()
System.Windows. Forms.Applicati on.DoEvents()
System.Windows. Forms.Applicati on.Run(New SplashScreen)
System.Windows. Forms.Applicati on.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 2691
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.whate ver

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******@discu ssions.microsof t.com> wrote in message
news:AA******** *************** ***********@mic rosoft.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.mydirec tory = Directory.GetCu rrentDirectory & _
"\data\sysconn. dbf"

Try

(Code)....

System.Windows. Forms.Applicati on.EnableVisual Styles()
System.Windows. Forms.Applicati on.DoEvents()
System.Windows. Forms.Applicati on.Run(New SplashScreen)
System.Windows. Forms.Applicati on.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
1062
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 mdiform that is MDIParent MDIChild MDIParent Controls I want the MDIChild to appear on top of everthing, that is
2
1621
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 controls. This MdiParent form has a menu bar that gives the user the ability to open child forms. My problem is when the child form(s) are opend and if the user moves the child form over the listview contol or text controls the listview and text...
4
1470
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 code, I pass the reference like this: private void btn_ListEmp_Click(object sender, System.EventArgs e) { frm_EmpList frm_empList = new frm_EmpList(this); frm_empList.MdiParent = this.MdiParent; frm_empList.Show();
1
1793
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 controls on the parent public, so i created a new project real quick w/2 forms. One is the MDIParent container and then one child form. On the MDIParent i put a textbox (textbox1) and set it to public. From the child code I just try to do a...
2
338
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 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
1
5830
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 (frmHistoricalCall). It also another menu item on frmCAD to "enabled = false", to prevent other forms being opened when frmHistoricalCall is in use. That menu item has it's modifier property set at "public".
9
2390
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 Public Class FormContainer Inherits System.Windows.Forms.Form
0
1537
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 = ((MDIMain)this.MdiParent).toolStrip; Tool.Enabled = false; or this way ((MDIMain)this.MdiParent).toolStrip.Enabled = false;
6
2424
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 connection string works fine and the tables are added to the project without a problem. When I create the tables they appear to bind and I am able to preview the data in the database in design mode; however, at runtime no data is displayed and the...
0
9679
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9527
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10453
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10172
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9050
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7546
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6785
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4115
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3730
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.