I applied the solution provided by the user to solve the problem, but this is another problem. I used to have an icon along with text, but after I used the code described here, my icon no longer displays. What could it be?
And how can I use the icon when using a color other than the default value in the tab title?
The solution I used is:
private void tabControl1_DrawItem(object sender, System.Windows.Forms.DrawItemEventArgs e) { TabPage CurrentTab = tabControl1.TabPages[e.Index]; Rectangle ItemRect = tabControl1.GetTabRect(e.Index); SolidBrush FillBrush = new SolidBrush(Color.Red); SolidBrush TextBrush = new SolidBrush(Color.White); StringFormat sf = new StringFormat(); sf.Alignment = StringAlignment.Center; sf.LineAlignment = StringAlignment.Center;
source share