Windows Develop Bookmark and Share   
 index > Windows Forms General > Win Form & Web Form Control Update from a thread in Assembly
 

Win Form & Web Form Control Update from a thread in Assembly

Hi ,

I have written an assemblyin C# which uses threads, and I want to add the reference of this assembly in bothWindows Form and ASP.NET Web Form.

There is a method in a thread of my assembly which shouldsend the current status of processingto Windows Form and Web Form .

My problem is, I first used the 'invoke and delegates' mechanismfrom my assembly to update WindowForm control , but this technique did't work on WebForm control as I could't find any equiavalent of 'Invoke' in WebForm .

Now I tried to use the Delegates and Events , I fire events from my assembly and try to catch those events in my WIndow Form , but getting error that "cross-thread operation is not valid" as I am trying to update GUI control frm my own thread....

Is there any way around to this ? I want to use technique through which I can update my both Win Form and Web Form controls !

Please I need help I m realy very badly struck here...

Thanks in advance.

C__Starter  Wednesday, April 18, 2007 5:13 PM
Using an event would be an easier approach. Just let the respective WF form and Web form install their own event handler and deal with the event as needed. The WF form would need to use Control.Invoke(), the Web form should do whatever it needs to do (no idea, really).
nobugz  Wednesday, April 18, 2007 7:37 PM
Using an event would be an easier approach. Just let the respective WF form and Web form install their own event handler and deal with the event as needed. The WF form would need to use Control.Invoke(), the Web form should do whatever it needs to do (no idea, really).
nobugz  Wednesday, April 18, 2007 7:37 PM

You can use google to search for other answers

Custom Search

More Threads

• Visual Studio 2008 VB.NET Generating Custom Code For A Windows Form From User Input
• VS 2005 Whidbey Beta 1 Server Explorer
• Securing files
• click event
• Alt-PrintScreen from VB?
• Automatic printing web reports
• Breakpoint Exception
• DialogResult
• SyncronizationContext null for console applicaitons
• Charts