Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: C# ADO.NET
Hello Guy's
I Need a help it is easy to right person to solve it
I'm make desktop application. there i take a some form like this
Form1 = Ismdicontainer = True
Form2 = Ismdicontainer = False
I am open a Form2 in Form1 that is working
but I want to open some form something like that
Form1 = Ismdicontainer = True
Form2 = Ismdicontainer = False
Form3 = Ismdicontainer = False
Now i want to open Form3 in Form1 butt when user click on button which is in from Form2
Form1 setting is Ismdicontainer = Talse
its is parent class function.
Thanks hope any ones help me soon..
waiting for sample code which help to open Form like this
Thank You
Posted 7-Dec-12 2:23am
Edited 7-Dec-12 2:27am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

That is fairly simple to do, but it's best not to do it in the way you think.
Because Form1 is the parent of both Form2 and Form3, it should be the only form which konws about them both - otherwise, the design of all three forms is locked together, and it becomes a lot harder to maintain them.
So what you do is to create an event in Form2 (call it ShowDetailsRequest or similar) which is Handled in Form1. The event handler than opens Form3 (or not, if it has a different way to display the information) after getting what information it needs from Form2 via public properties.
This is really easy to do: have a look here A simple code snippet to add an event[^] - the code you need is in the top of the Tip, the rest just describes how to make it easier to create them.
Comments at 7-Dec-12 7:36am
So is it easy to open Form1 = Ismdicontainer = True to Form3 = Ismdicontainer = True
OriginalGriff at 7-Dec-12 7:46am
Sorry - I don't understand what you are asking.
Please try to restate that, remembering that I can't see your screen! at 7-Dec-12 8:27am
My question is simple
I have Main Form where am opening all MidForm in Main Form but i want to open Form from Mid Form to Main Form in as a MidForm.
OriginalGriff at 7-Dec-12 8:32am
Don't do it that way - ask the main form to open the form for you - don't complicate the design by opening MDI children from MDI children - get the MDI Parent to do it for you, as I suggested above.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 381
1 Sergey Alexandrovich Kryukov 265
2 Praneet Nadkar 237
3 Marcin Kozub 225
4 /\jmot 189
0 OriginalGriff 8,284
1 Sergey Alexandrovich Kryukov 7,407
2 DamithSL 5,614
3 Maciej Los 4,989
4 Manas Bhardwaj 4,986

Advertise | Privacy | Mobile
Web04 | 2.8.1411023.1 | Last Updated 7 Dec 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100