Moving Borderless Forms Without Windows API
This an easy way to move a windows form without a border. It does now use the windows API very easy to understand code is very short. Simply click down on the form and move the mouse. the form will move with the mouse alot easier to use instead of the windows API
AI
AI 摘要: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.
源代码
Dim newPoint As New System.Drawing.Point() Dim a As Integer Dim b As Integer Private Sub Form1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseDown a = Me.MousePosition.X - Me.Location.X b = Me.MousePosition.Y - Me.Location.Y End Sub Private Sub Form1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseMove If e.Button = MouseButtons.Left Then newPoint = Me.MousePosition newPoint.X = newPoint.X - (a) newPoint.Y = newPoint.Y - (b) Me.Location = newPoint End If End Sub
原始评论 (3)
从 Wayback Machine 恢复