Groups | Blog | Home
all groups > dotnet windows forms controls > april 2008 >

dotnet windows forms controls : Custom TabControl - hide/customize left-right buttons


Olaf Rabbachin
4/17/2008 4:16:57 PM
Hi *,

I have created a custom TabControl (inherited from the default one). The
only thing that's still missing is to customize the behaviour when the
horizontal extension of the tab-strips exceeds the TabControl's width. In
this case, the original TabControl displays those two buttons on the top
right with which one can move between visible and invisible strips.

I wonder as to whether one could ...
1. find out whether the buttons are being displayed or not and when this
happens
2. hide the buttons and replace them with my custom ones

1. if there is no property that I overlooked this could at least be done
"manually" by i.e. comparing the overall width of all visible TabStrips to
the width of the control, although I would think that there really should
be some mechanism built into the control. Also, tracking the position of a
tab when i.e. the first one is not the visible one will produce quite some
work I guess.

2. is pretty annoying. It seems that those buttons are kind of "pushed"
into the control without publishing them as one would expect. That is, they
seem to be buried in the Win32 API that the control must be based on. Thus,
I seem to be unable to even retrieve their location and size. Also, drawing
"over" them doesn't work as they will be drawn on top of whatever my code
draws.

Has anyone succeeded in replacing them with their own code ..?

Cheers,
Martin M
6/19/2008 3:41:53 AM
Would you like to try the XTabControl from SpringSys?





[quoted text, click to view]

Olaf Rabbachin
6/19/2008 9:37:30 AM
Hi,

[quoted text, click to view]

actually I have opted to create a TabControl from scratch. The whole
process thus took way longer than planned, but I sure learned a lot as
well.

Cheers,
AddThis Social Bookmark Button