|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
cross Thread not validHi Guys,
I have a question on the Vb.net code I am working on. I have a winform that has a button that starts a thread, I would like to close the winform when thread finishes or crashes. Is there a way to call winform.close from the thread? Thank you Alan <elun***@hotmail.com> schrieb:
> I have a question on the Vb.net code I am working on. I have a winform Yes, you can call it by calling the form's 'Invoke' or 'BeginInvoke' method.> that has a button that starts a thread, I would like to close the > winform when thread finishes or crashes. Is there a way to call > winform.close from the thread? -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://dotnet.mvps.org/dotnet/faqs/> Thanks a lot for helping. My code looks like the following:
private sub run() try calculate() winform.close catch ex winform.close end try end function public sub button1_onclick() dim a as thread (addressof run) a.start end sub Can you help point out where I should use invoke and beginInvoke? Thank you! Herfried K. Wagner [MVP] wrote: Show quoteHide quote > <elun***@hotmail.com> schrieb: > > I have a question on the Vb.net code I am working on. I have a winform > > that has a button that starts a thread, I would like to close the > > winform when thread finishes or crashes. Is there a way to call > > winform.close from the thread? > > Yes, you can call it by calling the form's 'Invoke' or 'BeginInvoke' method. > > -- > M S Herfried K. Wagner > M V P <URL:http://dotnet.mvps.org/> > V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Windows Service, timer doesn't tick
Copy Directory Can forms in different projects reference one another? Transparent attribute for labels VB Guru please explain me how this can work ? split container variable value becoming null class and component class Help with some research Rendering Vector Images |
|||||||||||||||||||||||