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

Home Posts Topics Members FAQ

Invoking a child form from another child form

3 New Member
Hi,

I have three forms. "Main form" is a container and "Logon Form" is the child of this. I want to invoke another "AppLogin Form" from "Logon Form" as a child form to get the login details to a diff application. How can this be done?

If I make the Logon form as a container, its giving me the error " A form cannot be container and child..... ".Please do reply

Thanks in advance,
KMSDXB
Dec 3 '09 #1
4 1824
sanjib65
102 New Member
A child window can be a parent of another control.
For example, the Standard toolbar of Visual Studio is the parent of the buttons on it. If you close or hide the toolbar, its children disappear. At the same time, the toolbar is a child of the application's frame. If you close the application, the toolbar disappears, along with its own children. In this example, the toolbar is a child of the frame but is a parent to its buttons.
http://http://www.functionx.com/vbnet/Lesson08.htm

A small example:

Expand|Select|Wrap|Line Numbers
  1. GridView gv = new GridView();
  2. //some code
  3. Panel1.Controls.Add(gv);//here gv is the child control
  4.  
Dec 3 '09 #2
KMSDXB
3 New Member
Hi,

On invoking the new form from this child form, I'm getting this message:
"Form that was specified to be the MdiParent for this form is not an MdiContainer."

Could you please guide me on this?

The piece of code is as follows:

frmLogin oLogon = new frmLogin();
oLogon.MdiParen t = this; //error
oLogon.Show();
where the form frmLogin is set as a child form.
Dec 6 '09 #3
KMSDXB
3 New Member
Hi,

While invoking the new form from the child form, I'm getting the following error:
"Form that was specified to be the MdiParent for this form is not an MdiContainer."

The code is as follows:

frmLogin oLogon = new frmLogin();
oLogon.TopLevel = false;
oLogon.MdiParen t = this;
oLogon.Show();

The form frmLogin is the new child form to be invoked from the current form which itself is a child.

Please guide me on this.
Dec 6 '09 #4
newuserint
7 New Member
The error says it all, you need to creat and MDI Primary Form which will be parent for all the other forms.
Dec 11 '09 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

2
1759
by: F. Da Costa | last post by:
Hi, I'm trying to call/ mimic an onchange function/ event after a user has clicked a checkbox. In response to which a buncch of other ones need to be checked as well. The caveat is that each of those child-checkboxes need to have an onchange action take place. All of these child-boxes *have* got a working onchange eventListener attached (thx to an old post of Lasse Reichstein Nielsen). Following a snip that suggests (or so the...
3
2085
by: CJack | last post by:
hy, I have an mdi application, i create a child form and I want to know when a button is pressed while that child form is loaded. I have this code: private void frmTestBaby_KeyUp(object sender, System.EventArgs e) { MessageBox.Show("keyboard button pressed!");
2
3086
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 calling the child form, that works fine. The problem arrises when I want to show those controls again when I close the child form. Im sure BringToFront will work but im not sure how to do this from the child form.
3
5616
by: James Spibey | last post by:
Hi, I have an MDI application which has aboout 10 child windows. The way the app needs to work is that only one window should be visible at a time and it should be maximized within the parent window. I have set all my child windows to be WindowState.Maximized but after showing 2 or 3 windows, the windows all drop back to Normal state. I have tried various things to overcome this inclusing overriding OnResize etc but none seem to give...
3
1332
by: Huihong | last post by:
I found when invoking the same property of a base class, the MC++ compiler seems to emit incorrect IL code, and causes causes stack overflow: class Child : public Parent { __property void set_Text(String *s) { Parent::Text = s; } };
2
2907
by: Paul | last post by:
Hi this is related to a previous post, hopefully just a bit clearer description o the problem. I have a parent form that opens a new form (child form) while still leaving the parent form open. Although the child form has a close button (with java script) if the user navigates the parent form to another form the child form is still open. Just wondering if there is a way to close the child form when the user navigates away with the parent...
2
1963
by: QT | last post by:
Dear Sirs, I made a MDI Parent form and two MDI child form. I can open MDI child form from MDI parent form with; Dim UserChangePassword_Form As New UserChangePassword 'Set the Parent Form of the Child window. UserChangePassword_Form.MdiParent = Me
10
4027
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 application. What should happen, is that the main MDI form should close, taking the child forms with it. There is code to loop through the child forms, remove the controls on each of them, and then close the form, but this code should execute only...
2
14021
by: JohnR | last post by:
Let's say I have an MDI parent form with a textbox. If I create an MDI child form and, at runtime, move the MDI child window over the textbox on the MDI parent, the textbox appears in front of the MDI child window. How can I make the MDI child window appear in front of any controls that may be on the MDI parent? thanks, John
0
9541
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...
0
9247
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8242
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
6796
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
6074
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();...
0
4602
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4874
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2782
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2215
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.