' Draw a line around the control on its parent.
' Note that this assumes the parent has Line,
' ScaleX, and ScaleY methods, and a ScaleMode property.
Private Sub UserControl_Paint()
On Error Resume Next
Dim X As Single
Dim Y As Single
Dim wid As Single
Dim hgt As Single
X = UserControl.Extender.Left - Parent.ScaleX(120, _
vbTwips, Parent.ScaleMode)
Y = UserControl.Extender.Top - Parent.ScaleY(120, _
vbTwips, Parent.ScaleMode)
wid = Parent.ScaleX(Width + 240, vbTwips, _
Parent.ScaleMode)
hgt = Parent.ScaleY(Height + 240, vbTwips, _
Parent.ScaleMode)
Parent.Line (X, Y)-Step(wid, hgt), , B
End Sub
|