本文介绍了两个TabControls的设计/结构建议的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 所以这是关于两个TabControls的设计/结构问题。 我的Windows窗体有一个外部主TabControl,其TabPages将保存单独的备份作业信息。因此,例如,我可能有三个主要页面: [备份作业1] [备份作业2] [备份作业3] 当我点击[备份作业2]时,另一个TabControl将显示相关的TabPages: [备份作业1] [备份作业2 ] [备份作业3] [备份内容] [备份位置] [压缩] [加密] TabControls的复杂性在于,备份作业的内部TabControl可能没有备份作业,一个或多个,每个都有自己的内部TabControl和相关的TabPages。 所以我想我会创建外部TabControl和一个内部(备份作业)TabControl与它相关联的TabPages并使其不可见,仅用作模板。这样,当我点击菜单项创建新的备份作业时,我的代码可以使用这个隐藏的备份作业TabPage并使其可见并相应地加载它的数据。 但我发现你无法隐藏一个TabPage(看起来很奇怪,你不能这样做)所以这个想法就在窗外。我是否通过根据需要实例化每个备份作业然后设置备份作业内部TabControl的显示来完成所有代码? 或者是否存在另一种我不知道的方式? 感谢您的想法... So this is a design/structural question regarding two TabControls.My windows form has an outer main TabControl whose TabPages will hold individual backup job information. So, for example, I may have three main tabpages:[Backup Job 1] [Backup Job 2] [Backup Job 3]When I click on [Backup Job 2] another TabControl and it's associated TabPages will display:[Backup Job 1] [Backup Job 2] [Backup Job 3][What To Backup] [Where To Backup] [Compression] [Encryption]The complexity here with the TabControls, is that the inner TabControl for the backup jobs may have no backup jobs, one or more, each with their own inner TabControl and associated TabPages.So I thought I would create the outer TabControl and one inner (backup job) TabControl with it's associated TabPages and make it invisible, only to be used as a template. Such that when I clicked on the menu item create new backup job, my code could use this 'hidden' backup job TabPage and make it visible and load it's data accordingly.But I found out you can't hide a TabPage (seems odd that you can't do that) so that idea went out the window. Am I left with creating new backup jobs by instantiating each one as needed and then setting up the display of the backup job inner TabControl, all by code?Or is there another way that I am not aware of?Thanks for your thoughts...推荐答案 嵌套选项卡控件以及任何其他导航控件都会让用户感到非常困惑,不仅是初学者,而且曾经有过相同的经验,因为这样的UI设计本质上令人困惑。 您应该检查您的UI设计,使其更具可用性和可读性。这只是一个想法:在外层和内层使用两种不同的导航控件样式。例如,对于一个级别,保持 TabControl ,对于其他级别,使用基于 ListBox的组合自定义(或用户控件)和面板组:当您从一个列表元素导航到另一个列表元素时,您将显示不同的面板,隐藏所有其他面板。每个面板将扮演与 TabControl 的 TabPage 相同的角色。 此外,您可以尝试重新考虑您的导航内容:它是真正的两级,还是这样的层次结构。也许不是,但是批判性地看一下你的设计很重要。 -SA Nested Tab Controls, as well as any other navigation controls, would greatly confuse the users, not only the beginners, but experienced once alike, because such UI design is confusing by nature.You should review your UI design to make it more usable and readable. This is just one idea: use two different navigation control styles on outer and inner levels. For example, for one level keep the TabControl, and for other, use combined custom (or user control) based on ListBox and set of panels: as you navigate from one list element to another, you show different panel, hiding all others. Each panel would play the same role as a TabPage of a TabControl.Besides, you can try to rethink your navigation content: is it really two-level, or is such hierarchy artificial. Maybe not, but it's important to critically look at your design.—SA 这篇关于两个TabControls的设计/结构建议的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-28 15:10