| | |
openin more forms C#
Please support our C# advertiser: $4.95 a Month - ASP.NET Web Hosting – Click Here!
Thread Solved
![]() |
•
•
Join Date: Aug 2008
Posts: 1,735
Reputation:
Solved Threads: 186
It seems to me more a logic issue than a specific language issue.
Your background thread would need to invoke the main thread to update and draw. Any secondary thread must not update the UI as it can/will cause locks.
Your background thread would need to invoke the main thread to update and draw. Any secondary thread must not update the UI as it can/will cause locks.
Did I just hear "You gotta help us, Doc. We've tried nothin' and we're all out of ideas" ? Is this you? Dont let this be you! I will put in as much effort as you seem to.
•
•
Join Date: Jul 2008
Posts: 27
Reputation:
Solved Threads: 0
•
•
•
•
It seems to me more a logic issue than a specific language issue.
Your background thread would need to invoke the main thread to update and draw. Any secondary thread must not update the UI as it can/will cause locks.
The function that does the update is in the Form2 class.
In it i have a:
public void Update()
{
lock(locker)
{
}
}
the both BGW's are callin it each to update his child form with collected data.
Do i need to put the update() function somwhere else and where or i can leave it in Form2 class.And should i remove the call of update from the BGW's and put the call in the mainForm button click event so the update and draw of the form is on button click event.
I'm not sure if i understood it good so please explaine your comment!!!!
thanks!!!
•
•
Join Date: Aug 2008
Posts: 1,735
Reputation:
Solved Threads: 186
The article I posted was about background threads, and updating the UI and how to go about it, the rules and gotchas of the whole event.
If you're calling an update of your form from within your thread, and the work is done from the thread - not the main UI thread then, you can/will get issues of locking up - wether you use locks or not.
If you're calling an update of your form from within your thread, and the work is done from the thread - not the main UI thread then, you can/will get issues of locking up - wether you use locks or not.
Did I just hear "You gotta help us, Doc. We've tried nothin' and we're all out of ideas" ? Is this you? Dont let this be you! I will put in as much effort as you seem to.
•
•
Join Date: Jul 2008
Posts: 27
Reputation:
Solved Threads: 0
•
•
•
•
ms-help://MS.VSCC.v90/MS.msdnexpress.v90.en/dv_csref/html/656da1a4-707e-4ef6-9c6e-6d13b646af42.htm
Well if you think that this is your article on this link i tried to open it but i have opened some stuff on chinese or something like that and that's a problem because my chinese is not so good

If you could send me on mail: nikola.rosic6@gmail.com
Thanks
I have also tried to open it over the MS help and from the web.
•
•
Join Date: Jul 2008
Posts: 27
Reputation:
Solved Threads: 0
I have managed to solve the problem thanks to you.Well the problem was in my event which is in charge for updating of the child form as you have told me.All i did i put a new event BGW report progress event which is now calling the MyEvent function in Form2 class which is in charge for updating of child form!!!
Thanks for helping me with my problem!!!
P.S. despite i have solved my problem i would still like to read your article but i still can't find it so if you could mail it to me i would appreciate it.!!!
Thanks for helping me with my problem!!!
P.S. despite i have solved my problem i would still like to read your article but i still can't find it so if you could mail it to me i would appreciate it.!!!
![]() |
Other Threads in the C# Forum
- Previous Thread: Simpel string sorting
- Next Thread: How to sort a List of FileInfo just like in a Windows folder? (Same sort Function)
| Thread Tools | Search this Thread |
.net access algorithm alignment app array bitmap box c# c#gridviewcolumn check checkbox client combobox communication control conversion csharp custom database datagrid datagridview dataset datatable datetime decryption degrees developer draganddrop drawing encryption enum excel file focus form format forms function gdi+ grantorrevokepermissionthroughc#.net hospitalmanagementsystem image input install java list localization mandelbroth marshalbyrefobject math messagebox mouseclick mysql netcfsvcutil.exe numeric operator path photoshop php picturebox pixelinversion platform plotting pointer polynomial post programming properties radians read regex remote remoting richtextbox server sleep socket sql statistics string stringformatting study sun table text textbox thread time timer update usb usercontrol validation visualstudio webbrowser winforms wpf wpfc# xml






