• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1716
  • Last Modified:

Title format from a TabPage in a TabControl

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
ICSAutomation
Asked:
ICSAutomation
  • 3
  • 3
1 Solution
 
Éric MoreauSenior .Net ConsultantCommented:
Hi ICSAutomation,

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

Cheers!
0
 
ICSAutomationAuthor Commented:
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
 
Éric MoreauSenior .Net ConsultantCommented:
check these examples from the link above:
How to Change the colours of a Tabcontrols Header Item.
A Completely OwnerDraw TabControl.
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
ICSAutomationAuthor Commented:
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
 
Éric MoreauSenior .Net ConsultantCommented:
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
 
ICSAutomationAuthor Commented:
Thank's a lot!!
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now