Dear Jm.
Is what i ¡ve done on my sample uploaded, as you can see there is a class called TxRectangle.
Code:Public Class TxRectangle Private m_rec As Rectangle Private m_Tx As String Public Property Rec As Rectangle Get Return m_rec End Get Set(ByVal value As Rectangle) m_rec = value End Set End Property Public Property Tx As String Get Return m_Tx End Get Set(ByVal value As String) m_Tx = value End Set End Property End Class
All works fine, except the event :
Code:Private Sub PictureBox1_MouseMove(ByVal sender As Object, _ ByVal e As MouseEventArgs) Handles PictureBox1.MouseMove If Control.MouseButtons = Windows.Forms.MouseButtons.Left Then If Me.drawMode Then Me.InvalidateRectangle(Me.GetRectangle(Me.startPoint, Me.endPoint)) Me.endPoint = e.Location Me.InvalidateRectangle(Me.GetRectangle(Me.startPoint, Me.endPoint)) Me.PictureBox1.Update()There are no errors, but the rectangle is not dragged.... PLEASE... please.... hheeeeeellllp sir !!Code:ElseIf Me.selectedBoxIndex <> -1 Then Dim box As Rectangle = Me.txboxes(Me.selectedBoxIndex).Rec Dim location As Point = e.Location Me.InvalidateRectangle(Me.txboxes(Me.selectedBoxIndex)) box.Offset(location.X - Me.startPoint.X, _ location.Y - Me.startPoint.Y) ' Me.txboxes(Me.selectedBoxIndex) = box 'txboxes(Me.selectedBoxIndex).Rec.Offset(location.X - Me.startPoint.X, _ ' location.Y - Me.startPoint.Y) Me.startPoint = location Me.InvalidateRectangle(Me.txboxes(Me.selectedBoxIndex)) Me.PictureBox1.Update() End If End If End Sub
Frank




Reply With Quote
