J
John
I am programming an HP iPAQ 1950, using VB .NET. I have two threads, the
main thread and thread #2. I need thread #2 to be able to change a
control on a form. My code runs but does not change the control. I have
tried several permutations but nothing seems to work. Below is sample
code. Note that my delegate uses the EventHandler class because this is
what the help files said I needed to use. Thanks for your help.
--- Code in Module1 (thread 2)
frmChemScanner.CallChangeHdrColor()
--- Code in form frmChemScanner (main thread)
Public Sub CallChangeHdrColor()
Dim e As New EventArgs
Dim o As Object
Dim d As New EventHandler(AddressOf ChangeHdrColor)
Me.Invoke(d, New Object() {o, e})
End Sub
Sub ChangeHdrColor(ByVal sender As Object, ByVal e As EventArgs)
labDeleteMode.Visible = True
End Sub
John
P.S. Please don't respond to the return address.
main thread and thread #2. I need thread #2 to be able to change a
control on a form. My code runs but does not change the control. I have
tried several permutations but nothing seems to work. Below is sample
code. Note that my delegate uses the EventHandler class because this is
what the help files said I needed to use. Thanks for your help.
--- Code in Module1 (thread 2)
frmChemScanner.CallChangeHdrColor()
--- Code in form frmChemScanner (main thread)
Public Sub CallChangeHdrColor()
Dim e As New EventArgs
Dim o As Object
Dim d As New EventHandler(AddressOf ChangeHdrColor)
Me.Invoke(d, New Object() {o, e})
End Sub
Sub ChangeHdrColor(ByVal sender As Object, ByVal e As EventArgs)
labDeleteMode.Visible = True
End Sub
John
P.S. Please don't respond to the return address.