T
Tony Johansson
Hello!
This code does not work when I have them in this event handler
private void Form1_Load(object sender, EventArgs e)
{
Graphics gr = this.CreateGraphics();
string text = "I'm the best!";
Font myFont = new Font("Arial", 14, FontStyle.Bold);
gr.DrawString(text, myFont, new SolidBrush(Color.Green), 10, 10);
}
But if I instead put the code lines into the event handler Form1_Paint it
works
private void Form1_Paint(object sender, PaintEventArgs e)
{
Graphics gr = e.Graphics; ;
string text = "I'm the best!";
Font myFont = new Font("Arial", 14, FontStyle.Bold);
gr.DrawString(text, myFont, new SolidBrush(Color.Green), 10, 10);
}
So why does it not work when I have the code lines in event handler
Form1_Load ?
//Tony
This code does not work when I have them in this event handler
private void Form1_Load(object sender, EventArgs e)
{
Graphics gr = this.CreateGraphics();
string text = "I'm the best!";
Font myFont = new Font("Arial", 14, FontStyle.Bold);
gr.DrawString(text, myFont, new SolidBrush(Color.Green), 10, 10);
}
But if I instead put the code lines into the event handler Form1_Paint it
works
private void Form1_Paint(object sender, PaintEventArgs e)
{
Graphics gr = e.Graphics; ;
string text = "I'm the best!";
Font myFont = new Font("Arial", 14, FontStyle.Bold);
gr.DrawString(text, myFont, new SolidBrush(Color.Green), 10, 10);
}
So why does it not work when I have the code lines in event handler
Form1_Load ?
//Tony