Re: Multithreading and applicantion hangs

Tech-Archive recommends: Fix windows errors by optimizing your registry



Typo. It should be Control.InvokeRequired. We knew what you meant
though :)

Stoitcho Goutsev (100) wrote:
Don't ever call control methods and set properties from a thread different
than the one created the control. Of course there some that are safe to be
called, but as a rule of thumb don't do that. When you want to access
control form worker thread use Control.Invoke to marshal the code. In order
to find out where is ssafe to call a method or set a property you can use
Control's IsInvoleRequired property.

For more info:
http://msdn2.microsoft.com/en-us/library/ms171728.aspx


--
HTH
Stoitcho Goutsev (100)


.



Relevant Pages

  • Re: letting child control handler mousewheel event
    ... mousewheel event. ... "Stoitcho Goutsev " wrote: ... the message down to the control parent if the message is not handled. ... child. ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: letting child control handler mousewheel event
    ... "Stoitcho Goutsev " wrote: ... handled differently by windows - simialar to the keyboard events. ... the message down to the control parent if the message is not handled. ... child. ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: Main thread calling event from child thread without using Ctrl.Inv
    ... Stoitcho Goutsev wrote: ... To work your sample the class Program needs to inherit from Control. ... Otherwise there is no Invoke method that will marshal the method call. ... BTW .NET 2.0 has BackgroundWorker component that is capable to marshal its events to the UI thread without the requirements of a control. ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: Scope UserControl to MainForm
    ... "Stoitcho Goutsev " wrote: ... You have to have a reference to the form in the user control. ... You can also use FindForm method from the UserControl code ... that has ShowControl method. ...
    (microsoft.public.dotnet.languages.csharp)