Tabless TabControl or custom control.

This forum can be browsed by the general public. Posting is limited to current SAPIEN license holders with active maintenance and does not offer a response time guarantee.
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.
This topic is 11 years and 3 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
User avatar
tjaywwi
Posts: 14
Last visit: Fri Aug 14, 2020 4:49 am

Tabless TabControl or custom control.

Post by tjaywwi »

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!
User avatar
greatmaker
Posts: 16
Last visit: Thu Mar 02, 2023 7:23 am

Tabless TabControl or custom control.

Post by greatmaker »

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))
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Tabless TabControl or custom control.

Post by davidc »

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
David
SAPIEN Technologies, Inc.
User avatar
tjaywwi
Posts: 14
Last visit: Fri Aug 14, 2020 4:49 am

Tabless TabControl or custom control.

Post by tjaywwi »

@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?
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Tabless TabControl or custom control.

Post by davidc »

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)
David
SAPIEN Technologies, Inc.
This topic is 11 years and 3 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.