Ver Mensaje Individual
  #6 (permalink)  
Antiguo 27/10/2006, 06:11
Avatar de SuperPinwi
SuperPinwi
 
Fecha de Ingreso: septiembre-2005
Mensajes: 317
Antigüedad: 18 años, 8 meses
Puntos: 1
Hola freegirl
Pues es q pensaba q era al seleccionar otra opción de menú pero realmente lo q pasa es q no se volvía a repetir como debería.
Lo acabo de solucionar gracias a una pequeña ayudita jeje
por si le sirve a alguien lo pego a continuación

Saludos y pasa un buen finde!

Código:
Private myDBThread As System.Threading.Thread 

    'First Sub to Call 
    Public Sub initThread() 
        myDBThread = New System.Threading.Thread(AddressOf Me.myWork) 
        actualizThreadState() 
    End Sub 

    'Thread Job 
    Public Sub myWork() 
        If myDBThread.ThreadState = Threading.ThreadState.Running Then 
            'I think that this sub is dedicated to sync data to you DB 
        Else 
            'the thread don't run ? 
            actualizThreadState() 
        End If 

    End Sub 

    ' 
    Function actualizThreadState() 
        If myDBThread.ThreadState = Threading.ThreadState.Stopped Then 
            'what to do when stop 
            ' for example an alert, or restart the thread .. 
        ElseIf myDBThread.ThreadState = Threading.ThreadState.Unstarted Then 
            'before it's started 
            myDBThread.Start() 
            myDBThread.IsBackground = True 
        End If 
    End Function 

    'Sub when the stop button is clicked 
    Private Sub ButtonSTOP_Click() 
        If myDBThread.ThreadState = Threading.ThreadState.Running Then 
            myDBThread.Abort() 
        End If 
    End Sub