如何在覆蓋整個工作區域的窗體上繪製圓圈?如何在覆蓋整個工作區的表單上繪製一個圓圈?
我試過下面的代碼。但是當我重新確定表格的大小時,這個圓圈是扭曲的。
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Paint(object sender, PaintEventArgs e)
{
Graphics g = e.Graphics;
g.SmoothingMode = SmoothingMode.AntiAlias;
Pen redPen = new Pen(Color.Red, 3);
Rectangle rect = new Rectangle(0,0, this.ClientSize.Width, this.ClientSize.Height);
g.DrawEllipse(redPen, rect);
}
}