且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在vb.net中将表单导航到表单

更新时间:2023-09-21 20:10:58

你的意思是当用户按下Form1上的按钮时,它会消失并且Form2会打开。

从Form2他可以按两个按钮 - 返回到Form1或显示Form3,在这种情况下,Form2消失,并显示相应的表格? Form3会发生类似的情况吗?



如果是这样的话,我会采用隐藏的父形式,从三个方面接受请求children和控制任何时候显示哪个实例。这些请求将采用父将处理的事件形式,并隐藏和显示相应的表单实例。声音很复杂?它不是 - 它实际上非常简单!

看看这个:在两种表格之间传递信息,第3部分:儿童与儿童 [ ^ ] - 它比你需要的更通用,但如果你读信息意味着请求显示不同的形式然后你应该明白。





错别字:表格为来自 和你的为你 - OriginalGriff [/ edit]
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]