开发者

Master page in C#

开发者 https://www.devze.com 2023-01-27 02:51 出处:网络
I have to design a control_panel form. This will have many tabs. How should I design this? Should I make differen开发者_开发知识库t new forms for each tab or is there a concept of Masterpage in C# Win

I have to design a control_panel form. This will have many tabs. How should I design this? Should I make differen开发者_开发知识库t new forms for each tab or is there a concept of Masterpage in C# WinForms?

Please give me your opinions. Thanks.


It's easy enough to whip up something like this in WinForms, using a TabControl, filled with several different TabPages, and a corresponding ImageList to hold the icons for each tab:

Master page in C#

Then you can just place the controls you want on each TabPage as you normally would. The designer has excellent built-in support for the TabControl, allowing you to simply click on the tab you want to switch to it as you could if your application was running. Here's a tutorial on implementing tabs in C#.

If you need more extensibility and encapsulation than provided by adding individual controls to each TabPage, you can create a custom UserControl corresponding to each of your tabs, and then place an instance of that UserControl into the TabPage. I don't really know much about MasterPages, but creating a base UserControl that all of your other UserControls inherit off (and then add their unique elements) of seems like it would provide similar functionality.


You have tab control in windows form. you can go through MSDN article for creating tabs.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号