C# 同一Label 设置不同字体颜色

private void label1_Paint(object sender, PaintEventArgs e)
{
string str = label1.Text;
string strA = str.Substring(0, str.Length / 2);
Point point = new Point(label1.Padding.Left, label1.Padding.Top);
TextRenderer.DrawText(e.Graphics, str, label1.Font, point, Color.Red);
TextRenderer.DrawText(e.Graphics, strA, label1.Font, point, Color.Blue);
}

你可能感兴趣的:(C#,Label,font)