|
-
December 24th, 2009, 04:21 PM
#1
Very basic question - Paint event
Hello,
I'm new in GDI+ and C# programming, though I have an experience in other programming languages.
Here is my question:
I started a new Windows Form Application project in Visual Studio 2008.
Then I double-clicked the Paint event of the form and added the following line to the Form1_Paint(..) method:
private void Form1_Paint(object sender, PaintEventArgs e)
{
e.Graphics.DrawEllipse(Pens.Red, 0, 0, 50, 50);
}
When I run the application I do see the circle, but I don't really understand what happened.
More specifically:
1) When does Form1_Paint(..) called ?
2) When does the Paint event of the form is raised ?
3) Why the Paint event is raised when I run the application ?
4) Why the circle is actually drawn on the form ? i.e. what is the relationship between the form class, the "PaintEventArgs e" argument, and the "e.Graphics" object ?
I will appreciate any help !
Thanks in advance !
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|