namespace WindowsFormsApplication1
{
public partial class frmWhyPaint : Form
{
public frmWhyPaint()
{
InitializeComponent();
}
private void btnCreatePie_Click(object sender, EventArgs e)
{
Graphics g = this.CreateGraphics();
g.FillPie(Brushes.Blue, 300, 100, 100, 100, 0, 360);
}
private void frmWhyPaint_Paint(object sender, PaintEventArgs e)
{
e.Graphics.FillPie(Brushes.Red, 100, 100, 100, 100, 0, 360);
}
}
}
開始程式後利用 Button 產生右邊的藍圓
沒有留言:
張貼留言