一窗多面板 [英] One Window For multiple Panels

查看:88
本文介绍了一窗多面板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我是一个非常出色的Web开发人员,但是现在我想尝试Windows窗体,但是我有一个问题,我如何在同一个窗口示例中创建多个面板,我的程序是:单击任意按钮后,菜单会带有多个按钮我必须关闭打开的窗口并在同一窗口中打开单击的窗口,而无需打开新窗口

问候

Hi guys i am a very good web developer but now i want to try the windows form but i have one question how can i create multiple panels in the same window example my program is: menu with multiple buttons once i click any button i have to close the opened one and open the clicked one in the same window no need to open a new window

regards

推荐答案

在一个窗口中创建多个面板并更改其可见性属性,在第一个面板关闭时,将第二个面板的可见性设置为true.
Create multiple panels in one window and change its visibility property,on close of 1st panel, sets 2nd panel visibility to true.


我认为,问题在于一般的编程概念...所以...

您可以使用TabControl来实现这一点,其中每个TabPage包含不同的控件.某些TabPages会被隐藏(例如,在其他不可见的TabControl中),直到用户单击菜单为止,但这是一个纯稚的概念!.

实现这一目标的更好方法是动态创建表单.
http://support.microsoft.com/kb/319266 [ http://en.csharp-online.net/Add_Controls_at_Run_Time [从头开始创建C#表单编辑器 [
I think, the question is abut general progamming concept... So...

You can use a TabControl to achive that, where each TabPage contains different controls. Some TabPages are hidden (for example in the other not visible TabControl) until user click menu, BUT this is a childlike concept!.

Better way to achive that is to create form dynamicly.
http://support.microsoft.com/kb/319266[^]
http://en.csharp-online.net/Add_Controls_at_Run_Time[^]
Crafting a C# Forms Editor from scratch[^]


这篇关于一窗多面板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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