Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

*sigh*

 

I just dont get it.

how do I raise a "safe" event in my UI Form from a worker thread? I do not know/cannot understand how to create events. That's all I want to know! no technical in depth lectures, no nothing. Can't find anything decent on google or if I do find it I can't follow it! Sooo frustrating.

 

using C# (so any code posted please post it in C#)

 

I have:

 

MainForm (UI)

ClassA (Worker thread)

ClassB (creates worker thread but can also be called from MainForm)

 

if a statusString has been changed in the WorkerThread or in ClassB, I want to notify this event in MainForm. When the MainForm identifies this event, I want to be able to do my own actions, in this case, change the label text on the form to statusString.

 

How?

  • *Experts*
Posted

I don't know if the separate Thread would get in the way of just declaring a deligate variable With Events. Then when the monitured action occurs Raise an Event with an Event Handler in MainForm to act on the monitured action.

 

Also, where and how is the worker thread created?

Member, in good standing, of the elite fraternity of mentally challenged programmers.

 

Dolphins Software

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...