Here is the exception I am getting:
System.InvalidOperationException: Invoke or BeginInvoke cannot be called on a control until the window handle has been created.
I can provide code
The last line is the line that the exception appears on. When I step through the code I don't get the exception, so I don't get it. Can anyone help me understand why this is happing.
FYI I just imported this project from VB 2003 to VB 2005 and apparently I was doing naught things the form because of the threading but I still am not sure what is happening here.
System.InvalidOperationException: Invoke or BeginInvoke cannot be called on a control until the window handle has been created.
I can provide code
Code:
...
Public Shared WithEvents frmLogin As New frmLogin
Public Shared thrdLogon As Thread
...
public shared sub main()
...
thrdLogon = New Thread(AddressOf LoginThread)
thrdLogon.Start()
frmLogin.BeginInvoke(New frmLogin.disableLoginDelegate(AddressOf frmLogin.DisableLogin))
The last line is the line that the exception appears on. When I step through the code I don't get the exception, so I don't get it. Can anyone help me understand why this is happing.
FYI I just imported this project from VB 2003 to VB 2005 and apparently I was doing naught things the form because of the threading but I still am not sure what is happening here.