请求在大型应用程序中导航的建议
我想创建一个具有不同视图的应用程序。我将不同的组件放在不同的面板中。通过单击按钮,我想查看属于该按钮的面板。除了将可见性设置为 false 之外,还有其他方法可以在面板之间导航吗?
或者是否有更好的方法使用面板以外的其他组件进行导航?
I want to create an application that has different views. I put my different components in different panels. By clicking on a button, I would like to see the panel that belongs to that button. Is there any other way to navigate between panels besides setting the visibility to false?
Or is there a better way to navigate using other components other than panel?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以使用 TabControl。
这允许您添加多个选项卡页面,并通过单击您想要查看的选项卡在它们之间进行切换。
更新
从您的评论来看,您似乎正在寻求创建一个向导。如果是这样,请参阅以下相关问题:
You can use a TabControl.
This allows you to add several TabPages and switch between them by clicking on the tab you want to see.
Update
From your comment it seems you are looking to create a wizard. If so, see these related questions:
在主窗体上只显示一个面板怎么样:
What about displaying only one panel on the main form:
最好不要一次将它们全部初始化:构建控件需要时间并消耗大量内存。
根据要求创建带有控件的面板。然后按照 anth 的建议进行操作。
It's better to not initialize them all at once: it takes time to build controls and consumes a lot of memory.
Create the panel with controls when requested. Then act as anth suggested.