whats wrong with my code...

Posts 16–18 of 18 · Page 2 of 2
Code:
 Private Property result As Short
    Private Declare Function GetAsyncKeyState Lib "User32" (ByVal vKey As Integer) As Short
Code:
 Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
    

        For i = 6 To 255


            result = 0
            result = GetAsyncKeyState(i)

            If GetAsyncKeyState(Keys.Right) Then
               


            End If

            If GetAsyncKeyState(Keys.F5) Then



            End If

            If GetAsyncKeyState(Keys.Left) Then
         


            End If

            If GetAsyncKeyState(Keys.F2) Then
           


            End If
        Next i
    End Sub
@AxiomFlux - your *first* bug described, the "printing of the time" thing...is an error with SendKeys(). This is too large of a project / too many possible errors to comment further.
Quote Originally Posted by Pingo View Post
Put an example of what you're writing in the textbox.

Also 2 timers isnt needed plus GetAsyncKeyState is a boolean in itself.
These arnt needed
Code:
Dim Hotkey1 As Boolean
Dim Hotkey2 As Boolean
Dim Hotkey3 As Boolean
This on one timer should work
Code:
            If GetAsyncKeyState(Keys.F5) Then
                SendKeys.Send("{Enter}")
                SendKeys.Send(TextBox1.Text)
                SendKeys.Send("{Enter}")
            End If

            If GetAsyncKeyState(Keys.F6) Then
                SendKeys.Send("{Enter}")
                SendKeys.Send(TextBox2.Text)
                SendKeys.Send("{Enter}")
            End If

            If GetAsyncKeyState(Keys.End) Then
                Close()
            End If

Code:
IIf(Directory.Exists("\Program Files (x86)"), Process.Start("run.bat"), Process.Start("run32.bat"))
The boolean dimmings are merely to keep code neat and easier to type dude.
Posts 16–18 of 18 · Page 2 of 2

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us