【发布时间】:2017-05-17 16:15:12
【问题描述】:
【问题讨论】:
-
请不要破坏您的帖子。通过在 Stack Exchange 网络上发布,您已授予 SE 分发该内容的不可撤销的权利(在 CC BY-SA 3.0 license 下)。根据 SE 政策,任何破坏行为都将被撤销。如果您想取消此帖子与您的帐户的关联,请参阅What is the proper route for a disassociation request?
【问题讨论】:
设置标签页的绘制模式:
tabControl1.DrawMode = TabDrawMode.OwnerDrawFixed;
tabControl1.DrawItem += tabControl1_DrawItem;
然后:
private void tabControl1_DrawItem(object sender, DrawItemEventArgs e)
{
e.DrawBackground();
var color = GetDesiredColor(e.Index); // TODO: Implement it for yourself
TextRenderer.DrawText(e.Graphics, tabControl1.TabPages[e.Index].Text, e.Font, e.Bounds, color);
}
当然,您可能也想调整边界。
【讨论】: