Running a thread on one form from another form
-
Hye Guys I am USing vb.net 2003. My problem is I have two Forms running togather and I want to run one procedure from FormA residing on Form B as a thread. but it gives me error that cannot run a thread from another thread. Can any one help me on this issue Rizwan Bashir
-
Hye Guys I am USing vb.net 2003. My problem is I have two Forms running togather and I want to run one procedure from FormA residing on Form B as a thread. but it gives me error that cannot run a thread from another thread. Can any one help me on this issue Rizwan Bashir
I think there are several ways to 'understand' you problem. I think you have two form in which you want to run a diffrent procedure : frmA.ProcedureA() and frmB.ProcedureB() If this is true, you can probably run ProcedureA() and ProcedureB() in seperate threads. If frmB is a child of frmA, then make sure not to open frmB as a dialog window, or make them a MDI child of frmMain or so... But once again, I don't exacly know what your problem is, can you explain a bit more to find a more accurate solution...
I love it when a plan comes together
-
I think there are several ways to 'understand' you problem. I think you have two form in which you want to run a diffrent procedure : frmA.ProcedureA() and frmB.ProcedureB() If this is true, you can probably run ProcedureA() and ProcedureB() in seperate threads. If frmB is a child of frmA, then make sure not to open frmB as a dialog window, or make them a MDI child of frmMain or so... But once again, I don't exacly know what your problem is, can you explain a bit more to find a more accurate solution...
I love it when a plan comes together
yes you are right. My situation is I have MDI Main. then a Child form A and another form ChildB. Now MDI Main and Child A is open. on specific event say button click of ChildA , ChlidB will open. Now at this time I want to run a procedure XYZ() on MDI Parent Form as a thread and also need to show the Child B at the same time. but have a problem saying cannot run a thread from another thread. Rizwan Bashir