Hi,
Is it possible to make a TabControl "tabless" or is there a panel which has more pages?
If there isn't, then is it possible to include a custom control like the ones in the link below and still be able to use them in design mode?
http://www.vbforums.com/showthread.php? ... ab-Control
http://stackoverflow.com/questions/4912 ... ab-headers
At the moment i'm trying to hide the tabs in the TabControl by setting the ItemSize to "0; 1", Fixed SizeMode and Appearance to Buttons which "hide" them but that isn't working very well and i can't set the ItemSize when the app is running because it doesn't redraw the buttons if i set Width/Height while it is running.
Thanks in advance!
Tabless TabControl or custom control.
Forum rules
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
- greatmaker
- Posts: 16
- Last visit: Thu Mar 02, 2023 7:23 am
Tabless TabControl or custom control.
In your code you can use the TabPages.Remove function. You must pass in a TabPage Item property. The below code shows an example of removing the 4th tab on my tab page.
$TABOptions.TabPages.Remove($TABOptions.TabPages.Item(3))
This will remove the first item on my tab page
$TABOptions.TabPages.Remove($TABOptions.TabPages.Item(0))
$TABOptions.TabPages.Remove($TABOptions.TabPages.Item(3))
This will remove the first item on my tab page
$TABOptions.TabPages.Remove($TABOptions.TabPages.Item(0))
Tabless TabControl or custom control.
To add a custom control you will have to use Add-Type and manually add it in the code.
An alternative is to remove all other tabs and only leave in the active tab.
Or you can use a stack panel controls instead and hide the non-active panels.
David
An alternative is to remove all other tabs and only leave in the active tab.
Or you can use a stack panel controls instead and hide the non-active panels.
David
David
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
Tabless TabControl or custom control.
@greatmaker
I already tried that but it doesn't fit into my project very well.
@davidc
If i use Add-Type i can't use the control in design mode or am i wrong?
When you say stack panel do you mean a control called StackPanel or that i should stack panels on top of each other and then show/hide them?
I already tried that but it doesn't fit into my project very well.
@davidc
If i use Add-Type i can't use the control in design mode or am i wrong?
When you say stack panel do you mean a control called StackPanel or that i should stack panels on top of each other and then show/hide them?
Tabless TabControl or custom control.
Correct, it will not appear in the designer. You could use a place holder control instead. Refer to ElementHost Control Set for a example on how to do this.
I meant you could stack the panels.
I recommend using a parent panel and place the child panels within side by side (easier to edit controls in the designer). When you make one visible, you also set the dock property to Fill. See the example I attached to this post.
David
Attached files /FileUpload/67/05c9159a9e4c94a960cf1dbb0afa5d.zip (1.6 KB)
I meant you could stack the panels.
I recommend using a parent panel and place the child panels within side by side (easier to edit controls in the designer). When you make one visible, you also set the dock property to Fill. See the example I attached to this post.
David
Attached files /FileUpload/67/05c9159a9e4c94a960cf1dbb0afa5d.zip (1.6 KB)
David
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.