Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tabstrip Tab-Font

Status
Not open for further replies.

waytech2003

Programmer
Jul 14, 2003
316
US
Is there a way, at runtime, to change the FontSize or FontBold, of each individual tab, on a the tabstrip control?

I have 5 tabs, and would like to make the font bold if there is valid data pertaining to that tab. I can not see any exposed properties that allow this, but was wondering if there is an API call to do it.

Any ideas?
 
I don't think the standard tabstrip allows you to do that but the Microsoft Tabbed Dialog Control will. However, that works in a different way to the tabstrip and personally I think it's more trouble than it's worth, the tabstrip is far more flexible.

If you're feeling brave you can create your own tabs for the tabstrip, in the example below I've created tabs to look like XP. What the image shows is a tabstrip with a standard VB picturebox placed over just the tabs, and then XP-style tabs drawn at the same positions and dimensions as the tabs on the underlying tabstrip. Once you've got that level of control you can do pretty much whatever you want - different coloured tabs, different fonts, tickboxes on the tabs and so on, even change the orange fade colour on the selected tab.

tabexample.bmp


- Andy
___________________________________________________________________
If you think nobody cares you're alive, try missing a couple of mortgage payments
 
Interesting idea. How do you determine in Top, Left, and height of the original Tabs?
 
Each tab has those properties:

tabstrip1.Tabs(x).Left | .Top | .Width | .Height etc.

In general the .Top and .Height properties will always be the same unless you have the tabstrip set to wrap, but then drawing the tabs on top becomes a lot more complicated.

- Andy
___________________________________________________________________
If you think nobody cares you're alive, try missing a couple of mortgage payments
 
I found my answer to Top, Left, Height

TabStrip1.Tabs(4).Top
TabStrip1.Tabs(4).Left
TabStrip1.Tabs(4).Height

Still would like to be able to get Font property via API call, if it there.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top