VB.net Taşınabilir Sürüklenebilir Form
- 10 sene önce, Burak Çalışkan tarafından yazılmıştır.
- VB.net Taşınabilir Sürüklenebilir Form için yorumlar kapalı
- Visual Basic,Yazılım
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
Public Class Form1 Dim drag As Boolean Dim mousex As Integer Dim mousey As Integer Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load End Sub Private Sub Form1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseDown drag = True mousex = Windows.Forms.Cursor.Position.X - Me.Left mousey = Windows.Forms.Cursor.Position.Y - Me.Top End Sub Private Sub Form1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseMove If drag Then Me.Top = Windows.Forms.Cursor.Position.Y - mousey Me.Left = Windows.Forms.Cursor.Position.X - mousex End If End Sub Private Sub Form1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseUp drag = False End Sub End Class |