Picture Box 点击委托事件
请问点击PictureBox后为什么没有执行pictureBox1_Paint
PictureBox?委托
private void pictureBox1_Paint(object sender, PaintEventArgs e)
{
Graphics g = e.Graphics;
string rdWords = GetRandomWords();
Font font = new System.Drawing.Font("Consolas", 18, FontStyle.Bold);
g.DrawString(rdWords, font, Brushes.Red, 5, 5);
}
private void pictureBox1_Click(object sender, EventArgs e)
{
PictureBox pb = new PictureBox();
pb.Paint += new PaintEventHandler(pictureBox1_Paint);
}