473,325 Members | 2,774 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 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 2381
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Paiam Salavati | last post by:
I want to change the the color of the tabs and the color of TabControl itself in a TabControl. Therefore I wrote the following code in my customized TabControl-class: this.DrawMode =...
0
by: Paiam Salavati | last post by:
I have to change the BackColor of the unused part to the right of the tabs in a TabControl. therefore I have overriden the onPaint-Method of TabControl like this: protected override void...
4
by: Max | last post by:
I have a form in my project, which based on the user selection (probably from a combo box) has to change its content. I guess the best way to describe it is if I had a TabControl on that form, then...
5
by: Zadkin | last post by:
Does anyone know, if it's possible to set the orientation of the tabpagebuttons to horizontal instead of vertical when the alignment property of my tabcontrol is set to left or right? Thanks in...
3
by: rossum | last post by:
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...
2
by: michael sorens | last post by:
After extensive searching of the docs, I find no mention of support for Ctrl-Tab and Ctrl-Shift-Tab to navigate among tabs in a TabControl. I am surprised that such a common/standard keyboard...
1
by: =?Utf-8?B?Qm9i?= | last post by:
I have converted a VB6 program to Visual Basic 2005 (Running on Windows XP). I have a TabControl with (2) tabs with left side alignment. My problem; with 2005 the Tab Captions (Text) does not...
0
by: Emmanuel Thiry | last post by:
Hi, I must program a Form that contains OCXs in a TabControl, each tab of which contains a single OCX. I created that with the Designer and it works ok. For different reasons, I decide to...
2
by: Gav | last post by:
I am writing an application where I will have a TabControl and 3 styles of Tabs to go in it, each containing different controls. The tabs will be added to the tabcontrol when items are clicked on...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.