Loading ...

Graphics Object - Draw Rectangle - Redraw Rectangle

Who is online?  0 guests and 0 members
home  »  forums   »  asp.net topics   »  getting started / general asp.net   » Graphics Object - Draw Rectangle - Redraw Rectangle

Graphics Object - Draw Rectangle - Redraw Rectangle

Posts under the topic: Graphics Object - Draw Rectangle - Redraw Rectangle

Posted: 8/24/2011

Lurker 55  points  Lurker
  • Joined on: 7/14/2011
  • Posts: 7

I have a bunch of rectangles within a picture box which i drew using the DrawRectangle method of the Graphics object. The code is similar to what is below:

Dim pen As New Pen(Brushes.LightSteelBlue, 2)
Dim r As Rectangle = New Rectangle(10, 10, 100, 200)
g.DrawRectangle(pen, r)

This works fine. However, once the user clicks a button I would like to redraw all of the rectangles in my picturebox with a new color. How would I loop through the rectangles in my picturebox and redraw each rectangle with a new color?


Page 1 of 1 (1 items)