none
Thread.abort RRS feed

  • Discussione generale

  • questo codice comprese le varie classi...

    clicca in vari punti del mio form job "bolle colorate"

    If Not running Then image.Close() Dim stealthWidth As Integer = CInt(Math.Truncate(CDbl(bottomRight.X - topLeft.X))) \ (Setting.griglia_WIDTH - 1) Dim stealthHeight As Integer = CInt(Math.Truncate(CDbl(bottomRight.Y - topLeft.Y))) \ (Setting.griglia_HEIGHT - 1) Dim s As New Simulatore_Click(New Point(topLeft.X - stealthWidth \ 2, topLeft.Y - stealthHeight \ 2), Setting.griglia_WIDTH, Setting.griglia_HEIGHT, stealthWidth, stealthHeight, Setting.SAMPLE_LENGTH, _ Setting.SENSITIVITY, Setting.COUNTER_THRESHOLD) botThread = New Thread(Sub() While running b.[Next]() Dim bmp As New Bitmap(50 * Setting.griglia_WIDTH, 45 * Setting.griglia_HEIGHT) For x As Integer = 0 To Setting.griglia_WIDTH - 1 For y As Integer = 0 To Setting.griglia_HEIGHT - 1 Dim c As Tipidicolore = s.Griglia(x, y)

    For _x As Integer = 0 To 14 For _y As Integer = 0 To 14 bmp.SetPixel(50 * x + _x, 45 * y + _y, If(c = Tipidicolore.Red, Color.Red, If(c = Tipidicolore.Green, Color.Green, If(c = Tipidicolore.Blue, Color.Blue, If(c = Tipidicolore.Yellow, Color.Yellow, If(c = Tipidicolore.Purple, Color.Purple, If(c = Tipidicolore.Special, Color.Gray, Color.Gray))))))) Next Next Next Next End While End Sub) botThread.Start() running = True End If

     come interrompo il ciclo senza usare il timer

     Private Sub Timerstartgame_Tick(sender As Object, e As EventArgs) Handles Timerstartgame.Tick
            running = False
            Timerstartgame.Stop()
        End Sub

    oppure senza usare i tasti Hotkeys

    Protected Overrides Sub WndProc(ByRef m As Message)
            Try
                If m.Msg = &H312 Then
                    Select Case m.LParam.ToInt32()
                        Case 4456449
                            ' ALT + D
                            botThread.Abort()

    grazie

    • Tipo modificato Irina Turcu venerdì 11 luglio 2014 15:19 In attesa di maggiori dettagli nel caso l"OP volesse continuare il troubleshooting del problema.
    mercoledì 4 giugno 2014 19:50

Tutte le risposte