[Visual Basic] Public Sub Paint( _
ByVal sender As Object, _
ByVal e As PaintEventArgs _
)
[Visual Basic] Public Sub Paint(ByVal sender As Object, ByVal e As PaintEventArgs)
If InResizeMode = True Or MoveControl = True Then Exit Sub
With e.Graphics
'Rahmen
.DrawRectangle(Pens.Gray, New Rectangle( _
mControl.Location.X - (GRS / 2), _
mControl.Location.Y - (GRS / 2), _
mControl.Width + GRS, _
mControl.Height + GRS))
'Positionen für die GrabRects in der Reihenfolge:
'TopLeft, TopMiddle, TopRight, MiddleLeft, MiddleRight, BottomLeft,BottomMiddle,BottomRight
Dim GrabRectPos() As Point = { _
New Point(mControl.Location.X - GRS, mControl.Location.Y - GRS), _
New Point(mControl.Location.X + (mControl.Width / 2) - (GRS / 2), mControl.Location.Y - GRS), _
New Point(mControl.Location.X + mControl.Width, mControl.Location.Y - GRS), _
New Point(mControl.Location.X - GRS, mControl.Location.Y + (mControl.Height / 2) - (GRS / 2)), _
New Point(mControl.Location.X + (mControl.Width), mControl.Location.Y + (mControl.Height / 2) - (GRS / 2)), _
New Point(mControl.Location.X - GRS, mControl.Location.Y + (mControl.Height)), _
New Point(mControl.Location.X + (mControl.Width / 2) - (GRS / 2), mControl.Location.Y + (mControl.Height)), _
New Point(mControl.Location.X + mControl.Width, mControl.Location.Y + (mControl.Height))}
For i As Integer = 0 To GrabRects.Length - 1
GrabRects(i).Location = GrabRectPos(i)
GrabRects(i).Size = New Size(GRS, GRS)
GrabRects(i).BackColor = Color.White
GrabRects(i).Parent = mOwnerForm
Next
GrabRects(4).BackColor = GrabRectColor
GrabRects(6).BackColor = GrabRectColor
GrabRects(7).BackColor = GrabRectColor
End With
End Sub
Plattformen: Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition