Click here to Skip to main content
15,905,028 members
Home / Discussions / C#
   

C#

 
AnswerRe: A timer & a while function Pin
Skippums27-Nov-07 6:58
Skippums27-Nov-07 6:58 
GeneralRe: A timer & a while function Pin
danzar27-Nov-07 11:14
danzar27-Nov-07 11:14 
AnswerRe: A timer & a while function Pin
led mike27-Nov-07 7:41
led mike27-Nov-07 7:41 
GeneralRe: A timer & a while function Pin
danzar27-Nov-07 11:26
danzar27-Nov-07 11:26 
GeneralRe: A timer & a while function Pin
led mike27-Nov-07 11:41
led mike27-Nov-07 11:41 
QuestionRegular expressions Pin
hamidkhan27-Nov-07 6:21
hamidkhan27-Nov-07 6:21 
AnswerRe: Regular expressions Pin
Skippums27-Nov-07 6:53
Skippums27-Nov-07 6:53 
AnswerRe: Regular expressions Pin
TJoe27-Nov-07 8:41
TJoe27-Nov-07 8:41 
GeneralRe: Regular expressions Pin
Skippums27-Nov-07 11:09
Skippums27-Nov-07 11:09 
GeneralRe: Regular expressions Pin
TJoe27-Nov-07 12:33
TJoe27-Nov-07 12:33 
GeneralRe: Regular expressions Pin
hamidkhan8-Dec-07 5:22
hamidkhan8-Dec-07 5:22 
QuestionCombo Box.ValueMember Problem Pin
sajid.salim.khan27-Nov-07 6:00
sajid.salim.khan27-Nov-07 6:00 
AnswerRe: Combo Box.ValueMember Problem Pin
led mike27-Nov-07 6:13
led mike27-Nov-07 6:13 
AnswerRe: Combo Box.ValueMember Problem Pin
pmarfleet27-Nov-07 6:16
pmarfleet27-Nov-07 6:16 
GeneralRe: Combo Box.ValueMember Problem Pin
sajid.salim.khan27-Nov-07 6:24
sajid.salim.khan27-Nov-07 6:24 
QuestionVariables and Command Button Pin
Chip Lambert27-Nov-07 5:19
Chip Lambert27-Nov-07 5:19 
AnswerRe: Variables and Command Button Pin
darkelv27-Nov-07 5:25
darkelv27-Nov-07 5:25 
GeneralRe: Variables and Command Button Pin
Chip Lambert27-Nov-07 5:29
Chip Lambert27-Nov-07 5:29 
GeneralRe: Variables and Command Button Pin
Colin Angus Mackay27-Nov-07 5:30
Colin Angus Mackay27-Nov-07 5:30 
GeneralRe: Variables and Command Button Pin
darkelv27-Nov-07 5:33
darkelv27-Nov-07 5:33 
AnswerRe: Variables and Command Button Pin
szukuro27-Nov-07 5:26
szukuro27-Nov-07 5:26 
QuestionWindows form and filesystem watcher threading issue Pin
tsiv27-Nov-07 4:28
tsiv27-Nov-07 4:28 
Hi
I have a problem while using the Filesystem watcher component in conjunction with a Windows form application.

I'm trying to do the following:

The form should show the content based on af file (which can be modified from another application!) and this should be done dynamically while the form runs...

So what I've done is to add a standard form to the app and then build the form contents dynamically based on the information contained in a file. The form contents is a panel and on that some labels and picture boxes...

So I would like to register a filesystem event monitor to detect when the file changes and re-create the Panels contents dynamically...now the problem occus...!

When trying to update the panel I get an error saying that:

Cross-thread operation not valid : Control 'pnlUpdates' accessed from a thread other than the thread it was created on.

The line of code that causes this error is:

pnlUpdates.Controls.Add(lblTest);

I suppose it is because the filesystem watcher is running in another thread and therefore this is not allowed?? I tried to use a backgroundworker to allow the update but this fails if I start the process from the OnChanged event of the Filesystem eventwatcher (same thread error as above)...

Anyone who knows how this can be done?

Kind regards

Thomas

AnswerRe: Windows form and filesystem watcher threading issue Pin
Vikram A Punathambekar27-Nov-07 4:41
Vikram A Punathambekar27-Nov-07 4:41 
GeneralRe: Windows form and filesystem watcher threading issue Pin
tsiv27-Nov-07 5:55
tsiv27-Nov-07 5:55 
GeneralRe: Windows form and filesystem watcher threading issue Pin
led mike27-Nov-07 6:02
led mike27-Nov-07 6:02 

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.