public partial class Form1 : Form
{
bool shouldpaint = false;
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void Painter_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
{
shouldpaint = true;
}
private void Painter_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
{
shouldpaint = false;
}
private void Painter_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
{
if (shouldpaint)
{
Graphics graphics = CreateGraphics();
graphics.FillEllipse(new SolidBrush(Color.BlueViolet), e.X, e.Y, 8, 8);
}
}
}
我想在窗体上面画画,但就是画不出来,运行后也没有提示出错,这是怎么回事啊?
高手指点指点啊!~~