Tilted Forum Project Discussion Community

Tilted Forum Project Discussion Community (https://thetfp.com/tfp/)
-   Tilted Technology (https://thetfp.com/tfp/tilted-technology/)
-   -   [C#] Hiding a Tab (https://thetfp.com/tfp/tilted-technology/87340-c-hiding-tab.html)

Artsemis 04-16-2005 10:44 AM

[C#] Hiding a Tab
 
Okay I have the following:
Code:

private System.Windows.Forms.TabPage tab1;
And I need to hide this tab when a certain menu Item is clicked. In the code for the menuitem, I have the following:
Code:

tab1.Hide();
And nothing is happening. The other code I have contained in that same block is working fine, I just cant get the tab hidden.



Thanks :)

Pragma 04-16-2005 09:54 PM

It's been a little bit since I've worked with C# doing Windows Forms, but the Tag object should have a "Visible" property - can you set it to false?

Artsemis 04-17-2005 12:37 AM

No. There is a visible property for the tab controller that holds all of the tabs, but hiding it obviously hides all tabs.

oblar 04-17-2005 08:04 PM

ugh.. I want to say I have done this, but I don't remember completely.

I can tell you a dirty hack to get the needed output. Build two Tab Containers and when they click something make one of them visible and hide the other one. This will basically just switch out the entire controller for the "new" one.

ketamine 04-17-2005 11:59 PM

This might be what you want:

Code:

// "hide" tab page
tabControl1.TabPages.Remove(tabPage1);

// and to show it again, just re-add it to the collection:
tabControl1.TabPages.Add(tabPage1);


Artsemis 04-18-2005 11:18 AM

i love you


All times are GMT -8. The time now is 01:18 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Search Engine Optimization by vBSEO 3.6.0 PL2
© 2002-2012 Tilted Forum Project


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62