Torna al Thread

Public Class Form1 Dim var As Integer Dim var2 As Integer Private Sub Form1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Click End Sub Private Sub Form1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseMove If var <> 0 Then Dim prova = Control.MousePosition Button1.Location = New Point(prova.X, prova.Y) Label1.Text = "X: " & Button1.Location.X & "; Y: " & Button1.Location.Y End If If var2 <> 0 Then End If End Sub Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click End Sub Private Sub Label2_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Label2.MouseDown var2 = 1 Dim prova = Control.MousePosition Label2.Location = New Point(prova.X, prova.Y ) Label1.Text = "X: " & Button1.Location.X & "; Y: " & Button1.Location.Y End Sub Private Sub Form1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseUp var2 = 0 End Sub End Class
Copyright © dotNetHell.it 2002-2024
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5