|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
update ui with delegateHELP
I have component that need to update the UI. The component raises an event on the main form which update the UI. Every time I execute the event I get an error that state the controls must be on the same thread I think I need to use delegate to update the UI. I have created a delegate, but the update is still on the component thread not the main UI thread. I know I am doing something wrong, but can not get it worked out. My knowledge of delegates is not great. Can somebody give me an answer to this problem Thanks Norm In article <OW1yR3FQFHA.2***@TK2MSFTNGP15.phx.gbl>, norm wrote:
Show quoteHide quote > HELP You need to look at the documentation for Control.Invoke... Using this> > I have component that need to update the UI. > The component raises an event on the main form which update the UI. > Every time I execute the event I get an error that state the controls must > be on the same thread > > I think I need to use delegate to update the UI. > I have created a delegate, but the update is still on the component thread > not the main UI thread. > > I know I am doing something wrong, but can not get it worked out. > My knowledge of delegates is not great. > > Can somebody give me an answer to this problem > > Thanks > Norm > > method, it will cause the function to be called on the thread the control is on. -- Tom Shelton [MVP] "norm" <n*@nn.com> schrieb: In addition to the other replies:> I have component that need to update the UI. > The component raises an event on the main form which update the UI. > Every time I execute the event I get an error that state the controls must > be on the same thread > > I think I need to use delegate to update the UI. > I have created a delegate, but the update is still on the component thread > not the main UI thread. Multithreading in Windows Forms applications <URL:http://dotnet.mvps.org/dotnet/faqs/?id=multithreading&lang=en> -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/>
Listview size
Enumerator vs ForNext vs ForEach Working between forms Is there anyway to tell when code is executing at compile time? Conversion from VB6 to VB.NET Architectural Question API calls in DotNet Retrieving Child Rows currentDomain.UnhandledException formatting datagrid error Async Delegate question |
|||||||||||||||||||||||