473,495 Members | 2,128 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Parent and child forms

Teo
Hi!!
I created a form that I already set as IsMdiContainer to True.
How can I tell each new form I create to work under the container form
without having to declare the
aboutfsm.MdiParent = Me
login.MdiParent = Me
NEWPILOT.MdiParent = Me
to every single form I create.
Any suggestions?

Also, how can I tell my form to use the available space inside the container
form when opening?
I tried Maximized when setting the default form load but doesn't work.

Thanks much in advance.

Teo

Jan 20 '08 #1
1 1482
"Teo" <no*******@homsany.netschrieb:
I created a form that I already set as IsMdiContainer to True.
How can I tell each new form I create to work under the container form
without having to declare the
aboutfsm.MdiParent = Me
login.MdiParent = Me
NEWPILOT.MdiParent = Me
to every single form I create.
Any suggestions?
How many different form types do you have?! You could save some lines of
code by writing a procecure:

\\\
Public Sub ShowFormInContainer( _
ByVal ChildForm As Form _
)
ChildForm.MdiParent = Me
End Sub
....
ShowFormInContainer(New AboutForm())
ShowFormInContainer(New LoginForm())
....
///
Also, how can I tell my form to use the available space inside the
container form when opening?
I tried Maximized when setting the default form load but doesn't work.
Did you try to maximize the forms in the child forms' 'Load' event handlers
or in the 'Load' event handler of the MDI container?

If your child forms are always maximized, you may want get back to a normal
form as the main form which contains a tabcontrol whose pages host user
controls. Each child form can then be replaced by a user control.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Jan 20 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3050
by: Brindley | last post by:
Hi there, In my Mdi application, I have placed a set of controls on the parent form to call child forms. The problem is that the controls hide the child forms. I have used SendToBack when Im...
25
6173
by: Steve Jorgensen | last post by:
Yup, Steve's full of tips, but hey, it makes him feel important, right? Ok, here goes. I've been trying to improve encapsulation by putting code in the same object as the stuff it affects, so I...
3
9671
by: Maheshkumar.R | last post by:
Hi groups, How i can command over the MDI CHIlD forms created dynamically at runtime from PARENT. Let say, i have generated 5 mdichild forms, but i want to work with child form1 from MDI...
2
3396
by: Jim Shank | last post by:
I am really trying to find the best OOP way of doing this. I have a parent MDI form with multiple children and I am trying to communicate variables between them. I have been able to successfully...
6
9408
by: Edwinah63 | last post by:
Hi everyone, could someone give me some thoughts on the best way to manage mdi parent and child forms? in vb6 i could scroll through the forms collection and determine which forms were...
10
3980
by: Charles Law | last post by:
For some reason, when I click the X to close my MDI parent form, the action appears to be re-directed to one of the MDI child forms, and the parent remains open. I am then unable to close the...
3
2666
by: Eddie | last post by:
If FormMain = MDI parent, FormSub = Child parent, I execute FormSub from the menu like this way. FormSub^ sub = gcnew FormSub; sub->MdiParent = this; sub->Show(); This can generate child...
4
3594
by: raj_genius | last post by:
I hav two queries, whc are as follows: FIRSTLY: is it possible to access the controls(by name) of a parent form(MDI) from its child forms??if yes then how??plzz provide a coded example in VB if...
2
2794
by: Bob Johnson | last post by:
..NET 3.5: I have placed two controls at the top of an Mdi parent form. The top-most control is a Panel that is docked to the Top. Immediately below the Panel is a user control that is Anchored to...
1
3998
by: nupuragr82 | last post by:
I have a parent form and on button click I am calling a child page where i have a textbox and a button. On button click of child form I am passing the value of the Textbox to the Textbox in parent...
0
7120
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,...
0
6991
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...
0
7196
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
5456
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,...
1
4897
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...
0
4583
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...
0
3088
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
649
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.