vb.net选中图形 vbs编写图形窗口( 二 )


MyBase.OnMouseUp(e)
down = New Point(-1, -1)
selected = editting.ToList()
editting = Nothing
Invalidate()
End Sub
Protected Overrides Function ProcessKeyPreview(ByRef m As Message) As Boolean
Dim KeyCode As Keys = CInt(m.WParam) And CInt(Keys.KeyCode)
Dim d As Boolean
If m.Msg = H100 Or m.Msg = H104 Then d = True Else If m.Msg = H101 Or m.Msg = H105 Then d = False Else Return MyBase.ProcessKeyPreview(m)
If KeyCode = Keys.ShiftKey Then
shift = d
ElseIf KeyCode = Keys.Menu Then
alt = d
End If
Return MyBase.ProcessKeyPreview(m)
End Function
Protected Overrides Sub OnPaint(e As PaintEventArgs)
MyBase.OnPaint(e)
For Each c As Control In IIf(editting Is Nothing, selected, editting)
e.Graphics.DrawRectangle(New Pen(Color.Gray) With {.DashStyle = Drawing2D.DashStyle.DashDot}, c.Left - 1, c.Top - 1, c.Width + 1, c.Height + 1)
Next
If (down.X0) Then e.Graphics.DrawRectangle(New Pen(Color.Gray) With {.DashStyle = Drawing2D.DashStyle.DashDot}, rect)
End Sub
End Class
vb.net选中图形的介绍就聊到这里吧,感谢你花时间阅读本站内容,更多关于vbs编写图形窗口、vb.net选中图形的信息别忘了在本站进行查找喔 。

推荐阅读