Click here to Skip to main content
15,892,697 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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

VB
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

VB
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
Updated 7-Dec-12 1:27am
v2

1 solution

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.
 
Share this answer
 
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)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900