Click here to Skip to main content
15,923,087 members
Home / Discussions / C#
   

C#

 
AnswerRe: FarsiLibrary Pin
Dave Kreskowiak7-Aug-12 2:11
mveDave Kreskowiak7-Aug-12 2:11 
QuestionVideo Recording from a DVR using EMGU or DirectShow C# Pin
Gertlaub26-Aug-12 23:26
Gertlaub26-Aug-12 23:26 
QuestionRe: Video Recording from a DVR using EMGU or DirectShow C# Pin
Eddy Vluggen6-Aug-12 23:34
professionalEddy Vluggen6-Aug-12 23:34 
QuestionDisplay ports details which are opened in a particular ip address Pin
sarang_k6-Aug-12 23:25
sarang_k6-Aug-12 23:25 
AnswerRe: Display ports details which are opened in a particular ip address Pin
Eddy Vluggen6-Aug-12 23:32
professionalEddy Vluggen6-Aug-12 23:32 
AnswerRe: Display ports details which are opened in a particular ip address Pin
sarang_k7-Aug-12 1:40
sarang_k7-Aug-12 1:40 
GeneralRe: Display ports details which are opened in a particular ip address Pin
Eddy Vluggen7-Aug-12 1:48
professionalEddy Vluggen7-Aug-12 1:48 
AnswerRe: Display ports details which are opened in a particular ip address Pin
Avrillavigne7-Aug-12 19:57
Avrillavigne7-Aug-12 19:57 
GeneralRe: Display ports details which are opened in a particular ip address Pin
Pete O'Hanlon8-Aug-12 0:30
mvePete O'Hanlon8-Aug-12 0:30 
QuestionInteractive Service in Windows 7 Pin
1a3xxx6-Aug-12 22:14
1a3xxx6-Aug-12 22:14 
AnswerRe: Interactive Service in Windows 7 Pin
Eddy Vluggen6-Aug-12 22:46
professionalEddy Vluggen6-Aug-12 22:46 
GeneralRe: Interactive Service in Windows 7 Pin
1a3xxx7-Aug-12 0:29
1a3xxx7-Aug-12 0:29 
AnswerRe: Interactive Service in Windows 7 Pin
Eddy Vluggen7-Aug-12 0:37
professionalEddy Vluggen7-Aug-12 0:37 
GeneralRe: Interactive Service in Windows 7 Pin
1a3xxx7-Aug-12 0:49
1a3xxx7-Aug-12 0:49 
AnswerRe: Interactive Service in Windows 7 Pin
Eddy Vluggen7-Aug-12 1:06
professionalEddy Vluggen7-Aug-12 1:06 
GeneralRe: Interactive Service in Windows 7 Pin
1a3xxx7-Aug-12 1:37
1a3xxx7-Aug-12 1:37 
AnswerRe: Interactive Service in Windows 7 PinPopular
Eddy Vluggen7-Aug-12 1:47
professionalEddy Vluggen7-Aug-12 1:47 
GeneralRe: Interactive Service in Windows 7 Pin
1a3xxx7-Aug-12 2:07
1a3xxx7-Aug-12 2:07 
GeneralRe: Interactive Service in Windows 7 Pin
Dave Kreskowiak7-Aug-12 2:08
mveDave Kreskowiak7-Aug-12 2:08 
GeneralRe: Interactive Service in Windows 7 Pin
Eddy Vluggen7-Aug-12 2:41
professionalEddy Vluggen7-Aug-12 2:41 
GeneralRe: Interactive Service in Windows 7 Pin
1a3xxx7-Aug-12 2:54
1a3xxx7-Aug-12 2:54 
GeneralRe: Interactive Service in Windows 7 Pin
Eddy Vluggen7-Aug-12 3:24
professionalEddy Vluggen7-Aug-12 3:24 
GeneralRe: Interactive Service in Windows 7 Pin
Dave Kreskowiak7-Aug-12 2:07
mveDave Kreskowiak7-Aug-12 2:07 
GeneralRe: Interactive Service in Windows 7 Pin
1a3xxx7-Aug-12 2:09
1a3xxx7-Aug-12 2:09 
QuestionError: Text' threw an exception of type 'Microsoft.VisualStudio.Debugger.Runtime.CrossThreadMessagingException' Pin
taibc6-Aug-12 20:24
taibc6-Aug-12 20:24 
Hi friends,

I am trying to create a new thread to convert a file. But when starting running it, I get this error:

{Text = '((System.Windows.Forms.TextBox)(txtAddress)).Text' threw an exception of type 'Microsoft.VisualStudio.Debugger.Runtime.CrossThreadMessagingException'} System.Windows.Forms.TextBox

Please see my code:

C#
string sourceFile, destinationFile;

       private void ShowLoadingIcon()
       {
           if (InvokeRequired)
           {
               this.Invoke(new MethodInvoker(ShowLoadingIcon));

           }
           else
           {
               pixLoadingIcon.Visible = true;
           }
       }



       private void btnConvert_Click(object sender, EventArgs e)
       {
           ShowLoadingIcon();

           //start thread to process long running task
           System.Threading.Thread t = new System.Threading.Thread(() =>
           {
               ConvertFiles(sourceFile, destinationFile);
           });

           t.Start();

       }


       private void ConvertFiles(string src, string dest)
       {
           //long running task to convert files
       }


Are there anyone know how to fix it ?

Thanks and regards,

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.