如何在vb.net中将表单导航到表单 [英] How to navigate form to form in vb.net

查看:114
本文介绍了如何在vb.net中将表单导航到表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在vb.net项目中有三个表单。父母表格,儿童表格和大孩子表格。我需要从父表单导航到子表单,然后导航到子表单。但是,在某些情况下,我需要从大孩子表格回到父母表格。



请帮我在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,

推荐答案

你的意思是当用户按下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]


这篇关于如何在vb.net中将表单导航到表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆