Click here to Skip to main content
12,443,996 members (41,945 online)
Rate this:
 
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 1:23am
Updated 7-Dec-12 1:27am
v2

1 solution

Rate this: bad
 
good
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.
  Permalink  
Comments
bikramjeet.sm 7-Dec-12 7:36am
   
So is it easy to open Form1 = Ismdicontainer = True to Form3 = Ismdicontainer = True
OriginalGriff 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!
bikramjeet.sm 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 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
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160811.3 | Last Updated 7 Dec 2012
Copyright © CodeProject, 1999-2016
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