Click here to Skip to main content
15,896,111 members
Home / Discussions / C#
   

C#

 
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 
GeneralRe: Windows form and filesystem watcher threading issue Pin
tsiv28-Nov-07 0:22
tsiv28-Nov-07 0:22 
GeneralRe: Windows form and filesystem watcher threading issue Pin
led mike28-Nov-07 5:51
led mike28-Nov-07 5:51 
AnswerRe: Windows form and filesystem watcher threading issue Pin
Vikram A Punathambekar27-Nov-07 4:42
Vikram A Punathambekar27-Nov-07 4:42 
AnswerRe: Windows form and filesystem watcher threading issue Pin
Obaid ur Rehman27-Nov-07 4:44
Obaid ur Rehman27-Nov-07 4:44 
QuestionStore a pointer in a DataGridView cell? (or other method of referencing a pointer) [modified] Pin
alanteigne27-Nov-07 4:26
alanteigne27-Nov-07 4:26 
AnswerRe: Store a pointer in a DataGridView cell? (or other method of referencing a pointer) Pin
Skippums27-Nov-07 6:38
Skippums27-Nov-07 6:38 
GeneralRe: Store a pointer in a DataGridView cell? (or other method of referencing a pointer) Pin
alanteigne27-Nov-07 7:22
alanteigne27-Nov-07 7:22 
Questionmaybe someone here knows Pin
damianrda27-Nov-07 3:51
damianrda27-Nov-07 3:51 
AnswerRe: maybe someone here knows Pin
leppie27-Nov-07 4:13
leppie27-Nov-07 4:13 
GeneralRe: maybe someone here knows Pin
Vasudevan Deepak Kumar27-Nov-07 4:31
Vasudevan Deepak Kumar27-Nov-07 4:31 
AnswerRe: maybe someone here knows Pin
Vasudevan Deepak Kumar27-Nov-07 4:31
Vasudevan Deepak Kumar27-Nov-07 4:31 
AnswerRe: maybe someone here knows Pin
Obaid ur Rehman27-Nov-07 4:46
Obaid ur Rehman27-Nov-07 4:46 
GeneralRe: maybe someone here knows Pin
damianrda27-Nov-07 5:01
damianrda27-Nov-07 5:01 
Questionhow to know which procces['s] have access to a file Pin
combo_ci27-Nov-07 3:46
combo_ci27-Nov-07 3:46 

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.