472,969 Members | 1,533 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,969 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 2361
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: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
3
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.