tabcontrol

How to hide TabPage from TabControl [duplicate]

蓝咒 提交于 2019-11-26 05:56:11
问题 This question already has answers here : Hiding and Showing TabPages in tabControl (18 answers) Closed 3 years ago . How to hide TabPage from TabControl in WinForms 2.0? 回答1: No, this doesn't exist. You have to remove the tab and re-add it when you want it. Or use a different (3rd-party) tab control. 回答2: Code Snippet for Hiding a TabPage private void HideTab1_Click(object sender, EventArgs e) { tabControl1.TabPages.Remove(tabPage1); } Code Snippet for Showing a TabPage private void ShowTab1

How can I disable a tab inside a TabControl?

强颜欢笑 提交于 2019-11-26 04:24:44
问题 Is there a way to disable a tab in a TabControl? I am using C#. 回答1: The TabPage class hides the Enabled property. That was intentional as there is an awkward UI design problem with it. The basic issue is that disabling the page does not also disable the tab. And if try to work around that by disabling the tab with the Selecting event then it does not work when the TabControl has only one page. If these usability problems do not concern you then keep in mind that the property still works, it

WPF TabControl - Preventing Unload on Tab Change?

喜欢而已 提交于 2019-11-26 03:57:12
问题 Is there a way to prevent the Tab Unload/Reload when a tab changes in a WPF tab control? Or if that is not possible, is there a recommended method for caching the tabs contents so they don\'t have to be regenerated with each tab change? For example, one tab\'s UI is completely customizable and stored in the database. When the user selects an object to work on, the items in the customized layout get populated with that object\'s data. Users expect a minor delay on initial load or when

Hiding and Showing TabPages in tabControl

烈酒焚心 提交于 2019-11-26 02:59:10
问题 I am trying to show or hide tabpages as per user choice. If user selects gender male then form for male in a tabpage \"male\" should be displayed and if user selects female then similar next form should be displayed in next tab \"female\" I tried using tabControl1.TabPages.Remove(...) and tabControl1.TabPages.Add(...) It adds and removes the tabpages but doing so will loose my controls on tabpages too... i can\'t see them back. what\'s the problem here? 回答1: You could remove the tab page from

Hide TabControl buttons to manage stacked Panel controls

三世轮回 提交于 2019-11-26 02:23:31
问题 I need to handle multiple panels, containing variuous data masks. Each panel shall be visible using a TreeView control. At this time, I handle the panels visibility manually, by making the selected one visible and bring it on top. Actually this is not much confortable, especially in the UI designer, since when I add a brand new panel I have to resize every panel and then design it... A good solution would be using a TabControl, and each panel is contained in a TabPage. But I cannot find any

How do I bind a TabControl to a collection of ViewModels?

↘锁芯ラ 提交于 2019-11-26 00:47:43
问题 Basically I have in my MainViewModel.cs: ObservableCollection<TabItem> MyTabs { get; private set; } However, I need to somehow be able to not only create the tabs, but have the tabs content be loaded and linked to their appropriate viewmodels while maintaining MVVM. Basically, how can I get a usercontrol to be loaded as the content of a tabitem AND have that usercontrol wired up to an appropriate viewmodel. The part that makes this difficult is the ViewModel is not supposed to construct the