Public Class Form1 Private flgMouseDown As Boolean = False ' マウスが押された時のLabel1の座標 Private movedPoint As Point Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Me.Label1.Text = "動くラベル" Me.Label1.Font = New System.Drawing.Font("MS UI Gothic", 18.0!, System.Drawing.FontStyle.Regular, _ System.Drawing.GraphicsUnit.Point, CType(128, Byte)) Me.Label1.BorderStyle = BorderStyle.FixedSingle End Sub Private Sub Label1_MouseDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Label1.MouseDown If (Me.flgMouseDown) Then Return End If Me.flgMouseDown = True ' マウスを押したときの座標 Me.movedPoint = e.Location 'Console.WriteLine("MouseDown") End Sub Private Sub Label1_MouseUp(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Label1.MouseUp Me.flgMouseDown = False 'Console.WriteLine("MouseUp") End Sub Private Sub Label1_MouseMove(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Label1.MouseMove If Not Me.flgMouseDown Then Return End If Dim p As Point = Me.Label1.Parent.PointToClient(Cursor.Position) Me.Label1.Location = New Point(p.X - Me.movedPoint.X, p.Y - Me.movedPoint.Y) 'Console.WriteLine("MouseMove") End Sub End Class