Hi NewGuy,
First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need the text in tabcontrol to be
bold. If there is any misunderstanding, please feel free to let me know.
Searching in google, there are many people doing the same thing. First, we
set DrawMode property of the TabControl to OwnerDrawFixed. Then, we handle
the DrawItem event to draw our own text with particular fonts. Here is an
example:
private void tabControl1_DrawItem(object sender,
System.Windows.Forms.DrawItemEventArgs e)
{
Font tabFont = e.Font;
Brush backGroundBrush = new SolidBrush(SystemColors.Control);
Brush foreGroundBrush = new SolidBrush(SystemColors.WindowText);
TabControl aTabControl = (TabControl) sender;
TabPage tabPage = aTabControl.TabPages[e.Index];
string tabName = aTabControl.TabPages[e.Index].Text;
StringFormat tabStringFormat = new StringFormat();
Rectangle tabRectangle = new Rectangle(
e.Bounds.X
, e.Bounds.Y + 4
, e.Bounds.Width + 4
, e.Bounds.Height);
if ( e.Index == aTabControl.SelectedIndex)
{
tabFont = new Font(tabFont, FontStyle.Bold);
}
//Paint Tab Background
e.Graphics.FillRectangle(backGroundBrush, e.Bounds);
//Draw Tab Text
e.Graphics.DrawString(tabName, tabFont, foreGroundBrush, tabRectangle,
tabStringFormat);
}
HTH.
Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."