Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB.NET
I've three forms in vb.net project. A Parent Form, a child form and a grand child form. I need to navigate from parent form to child form and then grand child form. However, in some case I need to come back to parent form from grand child form.
 
Please help me how to do this in vb.net.
 
Thanks,
Posted 24-Apr-13 8:31am
Comments
ThePhantomUpvoter at 24-Apr-13 13:45pm
   
What do you mean "navigate"? SDI? MID? What is it that you think a "grand child form" would be?
Sergey Alexandrovich Kryukov at 24-Apr-13 13:51pm
   
Effectively, there are no parent-child relationships between forms, if you don't mean MDI children/parent, but you don't want to use MDI.
—SA

1 solution

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

Solution 1

Do you mean that when a user presses a button on Form1, it disappears and Form2 opens.
From Form2 he can press two buttons - "Back to Form1" or "Show Form3" in which case Form2 disappears and the appropriate form is displayed? And that something similar happens with Form3?
 
If so, the way I would do it is to have a Hidden "parent" form, which takes requests from the three "children" and controls which instance is displayed at any one time. These requests would be in the form of Events which the "Parent" would handle, and hide and show the appropriate form instances. Sound Complex? It isn't - it's actually really simple!
Have a look at this: Transferring information between two forms, Part 3: Child to Child[^] - it's more generic than you need, but if you read "information" to means "request to show a different form" then you should get the idea.
 

[edit]Typos: "Form" for "from" and "your" for "you" - OriginalGriff [/edit]
  Permalink  
v2

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

  Print Answers RSS
0 OriginalGriff 490
1 Maciej Los 299
2 BillWoodruff 174
3 /\jmot 170
4 Suraj Sahoo | Coding Passion 150
0 OriginalGriff 8,484
1 Sergey Alexandrovich Kryukov 7,407
2 DamithSL 5,639
3 Maciej Los 5,159
4 Manas Bhardwaj 4,986


Advertise | Privacy | Mobile
Web04 | 2.8.1411023.1 | Last Updated 24 Apr 2013
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