I am trying to learn graphics for VB.NET, the problem is I'm not really sure how this stuff works.
First of all, why do we have a Paint method and when does this method execute?
Also, is "ByVal e As System.Windows.Forms.PaintEventArgs" for and what does it mean? What about "ByVal sender As Object"?
What are you doing when you start off with this in a Paint method?
And, finally, could someone write up a quick example? Suppose I want to draw a rectangle in a picture box when the form is loaded and replace that rectangle with a circle when a button is pressed. How would I do this?
First of all, why do we have a Paint method and when does this method execute?
Also, is "ByVal e As System.Windows.Forms.PaintEventArgs" for and what does it mean? What about "ByVal sender As Object"?
What are you doing when you start off with this in a Paint method?
VB.NET:
Dim g As Graphics = e.Graphics
And, finally, could someone write up a quick example? Suppose I want to draw a rectangle in a picture box when the form is loaded and replace that rectangle with a circle when a button is pressed. How would I do this?