简体   繁体   English

使用Winform TabControl

[英]Using Winform TabControl

Is it good or bad practise to use tabs in winforms? 在Winforms中使用选项卡是好是坏做法?

Do you need to preform anything specail to pass objects between them? 您是否需要执行任何特殊操作才能在对象之间传递对象?

You can use Tab Control. 您可以使用“选项卡控件”。 Its totally safe. 它完全安全。

You do not need anything special to pass value between tabs. 您不需要任何特殊的选项卡之间传递值。

They are used when you want to open multiple forms in a single control that is your tabcontrol. 当您想在单个控件(即tab控件)中打开多个表单时,可以使用它们。

Those forms can be opened as Child/Content in Tab items. 这些表单可以在“选项卡”项中作为“子项/内容”打开。 Each and every one of them will maintain its state and value even if you switch from one tab to another. 即使您从一个选项卡切换到另一个选项卡,它们每个都将保持其状态和值。

Tabs are a suitable tool for grouping and organizing controls on a form. 选项卡是用于对表单上的控件进行分组和组织的合适工具。 They can help de-clutter a busy form. 他们可以帮助整理繁忙的表格。

You don't have to do anything special to pass data between controls on different tabs, as they're all on the same form. 您无需执行任何特殊操作即可在不同选项卡上的控件之间传递数据,因为它们都位于同一表格上。

It depends on the requirement, Tabs are good to group related controls, but sometimes it does not provide a very good user experience by hiding out some controls. 根据需求,选项卡可以很好地对相关控件进行分组,但是有时它不能通过隐藏某些控件来提供很好的用户体验。

You don have to do any thing to pass information in between them and you can access any control with in a tab, and controls in any tab can access from variables in which they are hosted. 您无需执行任何操作即可在它们之间传递信息,并且可以使用选项卡中的任何控件,并且任何选项卡中的控件都可以从托管它们的变量进行访问。

TabControl is a good control if you want to sort and avoid multiples new forms. 如果要排序并避免使用多个新表格,TabControl是一个很好的控件。 If you want to pass data between tabs, there's no problem because it's one control for multiple tabs. 如果要在选项卡之间传递数据,则没有问题,因为它是多个选项卡的一个控件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM