|
|||||||
|
|
|
![]() |
|
|
Strumenti |
|
|
#1 |
|
Senior Member
Iscritto dal: Sep 2002
Messaggi: 323
|
[VB.NET] Evento in thread in background
Salve a tutti. Mi chiedevo se fosse possibile mettere il seguente evento in un thread in background, in modo che l'applicazione sia "responsive":
Codice:
Private Sub PinChange(ByVal sender As Object, ByVal e As System.IO.Ports.SerialPinChangedEventArgs) Handles serialPort.PinChanged
Me.Invoke(New PinChangeDelegate(AddressOf updatePin), New Object() {})
End Sub
Public Delegate Sub PinChangeDelegate()
Public Sub updatePin()
Application.DoEvents()
If IO.Ports.SerialPinChange.CtsChanged And send_complete = False Then
Threading.Thread.Sleep(100)
InviaDati()
End If
End Sub
__________________
Intel Inside Pentium D 945 3.4GHz - 3GB DDR2 667Mhz Dual Channel (2x512MB+2x1GB) Kingston - ASUS P5LD2 - HDD Maxtor 250Gb SATA - ATI SAPPHIRE X1900XTX 512Mb - Alimentatore Corsair VX550W - Monitor LCD 19" Samsung SM 930BF - Windows 7 Ultimate. |
|
|
|
|
|
#2 |
|
Senior Member
Iscritto dal: Dec 2004
Messaggi: 3210
|
Sul multithreading in VB.NET sono anch'io in fase di "sperimentazione",
In generale devi impostare la proprietà del Thread desiderato .IsBackground = True ... |
|
|
|
|
|
#3 |
|
Senior Member
Iscritto dal: Sep 2002
Messaggi: 323
|
Si.. ma non riesco ad impostare il resto :S
__________________
Intel Inside Pentium D 945 3.4GHz - 3GB DDR2 667Mhz Dual Channel (2x512MB+2x1GB) Kingston - ASUS P5LD2 - HDD Maxtor 250Gb SATA - ATI SAPPHIRE X1900XTX 512Mb - Alimentatore Corsair VX550W - Monitor LCD 19" Samsung SM 930BF - Windows 7 Ultimate. |
|
|
|
|
| Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 03:21.



















