0
我使用下面的代碼來設置窗體中的按鈕的漸變。它的作品,但它的文字沒有顯示。我該怎麼做才能解決它? 謝謝。爲什麼文本不能顯示漸變按鈕?
private void Form1_Load(object sender, EventArgs e)
{
button2.Paint += new PaintEventHandler(this.Button2_Paint);
}
private void Button2_Paint(object sender, PaintEventArgs e)
{
Graphics g = e.Graphics;
g.FillRectangle(new System.Drawing.Drawing2D.LinearGradientBrush(PointF.Empty, new PointF(button2.Width, button2.Height), Color.Pink, Color.Red), new RectangleF(PointF.Empty, button2.Size));
}
謝謝親愛的Blablablaster。它非常棒... – John