March 28th, 2014, 01:23 PM
STA error Exception.InnerException
I need a little help on an InvalidoperationException was unhandled by user code.
The error occurs when I call this Sub located in a Module from a Timer (System.Timers.Timer) also located in the Module.
Thank you in advance.
This is a Google translation of the error message from VB.NET
An error occurred during the creation of the form. See Exception.InnerException for more information. The error was: User thread should be STA, because this is required for many UI components.
Public Sub SetSpeechActive(ByVal TurnOn As Boolean)
If TurnOn Then
frmMain.picSpeechActive.Image = System.Drawing.Image.FromFile(System.Windows.Forms.Application.StartupPath & "\images\online16.png")
frmMain.picSpeechActive.Image = System.Drawing.Image.FromFile(System.Windows.Forms.Application.StartupPath & "\images\offline16.png")
Click Here to Expand Forum to Full Width
This is a CodeGuru survey question.