473,396 Members | 1,757 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,396 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 2384
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.