471,338 Members | 1,001 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,338 software developers and data experts.

Highlighting tabs in a TabControl

I have a TabControl with a lot of tabs in it. Since it is sometimes
difficult to tell which tab is currently active (all the pages have
the same layout) I want to be able to highlight which tab is currently
active.

My first thought was to change the page's background colour, but that
just changed the background of the page body, not the background of
the page tab at the top. The same happened when I changed the page
font to bold, it affected the body of the page, but not the tab at the
top.

Then I switched to the TabControl itself. Setting text to bold
affected all the page tabs, not just the current one. I couldn't see
a way to switch the background colout, but I suspect that would have
the same effect.

I have resorted to just changing the text: "Page 20" <-> "*Page 20*"
which is a bit clunky and not really satisfying. Is there a better
way to highlight the active tab page label in a TabControl?

Thanks,

rossum

The ultimate truth is that there is no ultimate truth
Jul 21 '05 #1
3 2290
Only through ownerdraw. See the examples on my site:
http://dotnetrix.co.uk/tabcontrols.html

--
Mick Doherty
http://dotnetrix.co.uk/nothing.html
"rossum" <ro******@coldmail.com> wrote in message
news:dm********************************@4ax.com...
I have a TabControl with a lot of tabs in it. Since it is sometimes
difficult to tell which tab is currently active (all the pages have
the same layout) I want to be able to highlight which tab is currently
active.

My first thought was to change the page's background colour, but that
just changed the background of the page body, not the background of
the page tab at the top. The same happened when I changed the page
font to bold, it affected the body of the page, but not the tab at the
top.

Then I switched to the TabControl itself. Setting text to bold
affected all the page tabs, not just the current one. I couldn't see
a way to switch the background colout, but I suspect that would have
the same effect.

I have resorted to just changing the text: "Page 20" <-> "*Page 20*"
which is a bit clunky and not really satisfying. Is there a better
way to highlight the active tab page label in a TabControl?

Thanks,

rossum

The ultimate truth is that there is no ultimate truth

Jul 21 '05 #2
On Thu, 23 Jun 2005 08:07:12 +0100, "Mick Doherty"
<EX***********@AND.REMOVE.SQUAREBRACKETS.[mdaudi100#ntlworld.com]>
wrote:
Only through ownerdraw. See the examples on my site:
http://dotnetrix.co.uk/tabcontrols.html

Thanks for that Mick. I was afraid the answer was going to be along
those lines.

rossum
The ultimate truth is that there is no ultimate truth
Jul 21 '05 #3
You could just use TabControlEX which is available from my downloads
section.
http://dotnetrix.co.uk/controls.html

This has the option to select TabColor and SelectedTabColor via the
properties in TabControlEX, or if these are left at default, the tabs are
drawn using their associated tabpages BackColor. (These are new properties
and I'm not sure I like the implementation, but I couldn't think of a better
way to achieve this common request).

--
Mick Doherty
http://dotnetrix.co.uk/nothing.html
"rossum" <ro******@coldmail.com> wrote in message
news:c6********************************@4ax.com...
On Thu, 23 Jun 2005 08:07:12 +0100, "Mick Doherty"
<EX***********@AND.REMOVE.SQUAREBRACKETS.[mdaudi100#ntlworld.com]>
wrote:
Only through ownerdraw. See the examples on my site:
http://dotnetrix.co.uk/tabcontrols.html

Thanks for that Mick. I was afraid the answer was going to be along
those lines.

rossum
The ultimate truth is that there is no ultimate truth

Jul 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Paiam Salavati | last post: by
4 posts views Thread by Max | last post: by
3 posts views Thread by rossum | last post: by
2 posts views Thread by michael sorens | last post: by
1 post views Thread by =?Utf-8?B?Qm9i?= | last post: by
reply views Thread by Emmanuel Thiry | last post: by
2 posts views Thread by Gav | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.