mouse Move Application
*
Public Class Form1
#Region "global variables"
Dim point As New System.Drawing.Point()
Dim X, Y As Integer

#End Region
#Region "GUI"



Private Sub Form1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseMove
If e.Button = MouseButtons.Left Then
point = Control.MousePosition
point.X = point.X - (X)
point.X = point.Y - (Y)
Me.Location = point

End If
End Sub
Private Sub Form1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseDown
X = Control.MousePosition.X - Me.Location.X
Y = Control.MousePosition.Y - Me.Location.Y

End Sub
#End Region



End Class

이 게시물을

댓글'2'

2번째 동영상 코는 추후 올리겠 습니다.

이 댓글을

함흥처사 (작성자)
  • 2014.06.04
  • 수정: 2014.06.04 09:36:29

2번 영상 코드입니다


Public Class Form1

    Dim xwert As String = 0

    Dim ywert As String = 0

    Dim speed As String = 1

    Private Sub Timer1_Tick(sender As Object, e As System.EventArgs) Handles Timer1.Tick

        Label3.Text = "ist position ; x:" & Cursor.Position.X & "; y:" & Cursor.Position.Y

    End Sub

    Public Sub Soll_position()

        Label4.Text = "soll position: x" & xwert & "; y:" & ywert


    End Sub

    Private Sub TextBox1_TextChanged(sender As Object, e As System.EventArgs) Handles TextBox1.TextChanged

        xwert = TextBox1.Text

        soll_position()


    End Sub

    Private Sub TextBox2_TextChanged(sender As Object, e As System.EventArgs) Handles TextBox2.TextChanged

        ywert = TextBox2.Text

        soll_position()

    End Sub


    Private Sub TextBox3_TextChanged(sender As Object, e As System.EventArgs) Handles TextBox3.TextChanged

        If TextBox3.Text > 11 Then TextBox3.Text = 10

        If TextBox3.Text < 1 Then TextBox3.Text = 1

        If speed = 11 - TextBox3.Text Then

        End If

    End Sub


    Private Sub Button1_Click(sender As Object, e As System.EventArgs) Handles Button1.Click

        Do While Cursor.Position.X > xwert

            Windows.Forms.Cursor.Position = New Point(Cursor.Position.X - 1, Cursor.Position.Y)

            System.Threading.Thread.Sleep(speed * 100)

        Loop

        Do While Cursor.Position.Y > ywert

            Windows.Forms.Cursor.Position = New Point(Cursor.Position.X, Cursor.Position.Y - 1)

            System.Threading.Thread.Sleep(speed * 100)

        Loop

        Do While Cursor.Position.X < xwert

            Windows.Forms.Cursor.Position = New Point(Cursor.Position.X + 1, Cursor.Position.Y)

            System.Threading.Thread.Sleep(speed * 100)

        Loop

        Do While Cursor.Position.Y < ywert

            Windows.Forms.Cursor.Position = New Point(Cursor.Position.X, Cursor.Position.Y + 1)

            System.Threading.Thread.Sleep(speed * 100)

        Loop

    End Sub


   

End Class


이 댓글을

공유하기

SEARCH

MENU NAVIGATION