Torna al Thread
Public Sub Esegui(ByVal Automatico As Boolean)
m_dlgConnect.ShowDialog(Automatico)
Call Esegui(False)
' Qui c'è il problema
If m_dlgConnect.ok Then
With m_dlgConnect
Call Tws1.connect(.hostIP, .port, .clientId)
Dim msg As String
msg = "Connected to TWS server version " & Tws1.serverVersion() & _
" at " & Tws1.TwsConnectionTime()
txtServerResponses.Text = msg
End With
End If
End Sub
'quindi nel tick event
Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick
'//Qua piazzi il codice da eseguire
ElseIf txtEndDateTime.Text = Format("19:00:00") Then
Call Esegui(True)
End If
End Sub