Solved

Title format from a TabPage in a TabControl

Posted on 2006-11-20
6
1,629 Views
Last Modified: 2009-07-29
How can I change dynamicly the title (color and make it bold) of a TabPage in a TabControl? Because I added the TabPages dynamicly, I want to do it by using the TabPageIndex.
0
Comment
Question by:ICSAutomation
  • 3
  • 3
6 Comments
 
LVL 69

Expert Comment

by:Éric Moreau
ID: 17978253
Hi ICSAutomation,

see http://dotnetrix.co.uk/tabcontrols.html

Cheers!
0
 

Author Comment

by:ICSAutomation
ID: 17988650
Thank's so far.
I can change the Background of the tabpage, but the square, where the title is written, doesn't change the color. How can I also change the color of the square?
And how can I change the style of the title. I want to write it fat....
0
 
LVL 69

Expert Comment

by:Éric Moreau
ID: 17988734
check these examples from the link above:
How to Change the colours of a Tabcontrols Header Item.
A Completely OwnerDraw TabControl.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:ICSAutomation
ID: 17994396
very well, the I could set the backgroundcolor.
But I couldn't see how to change the textstyle of the title. I want, that it appears fat.
0
 
LVL 69

Accepted Solution

by:
Éric Moreau earned 150 total points
ID: 17995195
You surely have overriden the DrawItem event. This is the place where you need to modify it.

Here is an example of something I did to bold the text of the selected tab:
If CBool(e.State And DrawItemState.Selected) Then
    Dim f As Font = New Font(e.Font, FontStyle.Bold)
    e.Graphics.DrawString(Me.TabPages(e.Index).Text, f, Brushes.Red, r2, sf)
Else
    e.Graphics.DrawString(Me.TabPages(e.Index).Text, e.Font, b, r2, sf)
End If
0
 

Author Comment

by:ICSAutomation
ID: 17995923
Thank's a lot!!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction                                                 Was the var keyword really only brought out to shorten your syntax? Or have the VB language guys got their way in C#? What type of variable is it? All will be revealed.   Also called…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now