I’m trying to learn vb.net, the problem i’m having in working with the system.drawing class. I draw a rectangle and want to move it. The offset method seems to be designed to do this. but I can’t seem to make it work. here’s a snippet of code, any sugesstions are appreciated
Public Class frmLights
Inherits System.Windows.Forms.Form
Dim grpGraphics As System.Drawing.Graphics
Dim mrecSquare As New System.Drawing.Rectangle(32, 120, 20, 20))
Private Sub btnSquare_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSquare.Click
Dim bshDraw As System.Drawing.Brush
bshDraw = New SolidBrush(Color.Crimson)
grpGraphics = Me.CreateGraphics
grpGraphics.FillRectangle(bshDraw, mrecSquare)
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
mrecSquare.Offset(5, 5)
End Sub
end class