Ver Mensaje Individual
  #1 (permalink)  
Antiguo 15/08/2009, 12:54
carlozpk
 
Fecha de Ingreso: junio-2007
Mensajes: 5
Antigüedad: 17 años, 8 meses
Puntos: 0
[Ayuda con VB] No puedo hacer funcionar el script

Hola, pues soy novato en VB, queria ver si me podian ayudar corrigiendo el trabajo que llevo hecho, tengo conocimientos basicos de PHP y mas o menos me guie por es (porque ambos usan mucha logica). Yo lo hayo todo bien, no me lanza errores al depurar, pero no me funciona. Basicamente es un programa que al activar el checkbox empieza mandado sendkeys con un intervalo que depende del numero que el usuario coloque en TextBox1 (en milisegundos), pero no puedo hacerlo funcionar, espero que me puedan ayudar:

Código:
Public Class Form1
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub

    Private Sub TextBox1_TextChanged() Handles TextBox1.TextChanged
        Dim TextBox1 As Integer 'Esto
        TextBox1 = TextBox1
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If Button1.Enabled = True Then
            CheckBox1.Enabled = True
        End If
        AppActivate("Bloc de notas") 'Finds the window NOTEPAD
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        If Button2.Enabled = True Then
            CheckBox1.Enabled = False
        End If
        AppActivate("Bloc de notas") 'Finds the window NOTEPAD
    End Sub

    Private Sub CheckBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.Click
        If CheckBox1.Enabled = True Then
            Dim TextBox1 As Integer 'Esto
            TextBox1 = TextBox1
            Timer1.Interval = TextBox1 + 1 ' it is 1 sek, for 50 ms must be 50
        Else
            CheckBox1.Enabled = False
        End If

        If CheckBox1.Enabled = True Then
            Dim TextBox1 As Integer 'Esto
            TextBox1 = TextBox1
            Timer2.Interval = TextBox1 + 50 ' it is 1 sek, for 50 ms must be 50
        Else
            CheckBox1.Enabled = False
        End If

        If CheckBox1.Enabled = True Then
            Dim TextBox1 As Integer 'Esto
            TextBox1 = TextBox1
            Timer3.Interval = TextBox1 + 100 ' it is 1 sek, for 50 ms must be 50
        Else
            CheckBox1.Enabled = False
        End If

        AppActivate("Bloc de notas") 'Finds the window NOTEPAD
    End Sub

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        If CheckBox1.Enabled = True Then
            SendKeys.Send("d") ' Envia Scape
        Else
            Timer1.Enabled = False
        End If
    End Sub

    Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
        If CheckBox1.Enabled = True Then
            SendKeys.Send("s") ' Envia Right Arrow
        Else
            Timer2.Enabled = False
        End If
    End Sub

    Private Sub Timer3_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer3.Tick
        If CheckBox1.Enabled = True Then
            SendKeys.Send("f") ' Envia Enter
        Else
            Timer3.Enabled = False
        End If
    End Sub
End Class