Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mdiChild Background Worker from mdiParent 1

Status
Not open for further replies.

FGorilla

Programmer
Oct 19, 2006
7
IT
Hopefully a relatively simple question but I can't seem to find the answer.

If I start a backgroundworker on a child form and then want to check it from the parent form to see if it's running how would I go about it?

I've tried calling Form1.BackgroundWorker.IsBusy() but regardless of whether it is running it always returns False.

At the moment I have the code following code to open the form (I check first to see if it's already opened):
Code:
Dim NewMDIChild As New Form1()
NewMDIChild.MdiParent = Me
NewMDIChild.Show()
Form1 = nothing
I'm probably being a bit stupid but never mind!

Thanks
Chris
 
May I ask why you have 'Form1 = nothing'?

'Form1.BackgroundWorker.IsBusy()' won't work because Form1 isn't a usable object (cannot think what its called, sorry).

Try adding 'Public MyChild As Form1' in your Parent form, then do 'MyChild = New Form1...'. When you want to check the Worker, do 'MyChild.BackgroundWorker.IsBusy()'.

 
Well I've only just started .NET so wasn't quite sure what I was doing. Needless to say I have now removed the offending line!

Many thanks for your reply, it works pefectly.

I'm sure once I get the hang of all the intricacies I'll be fine, it's a little different coming from working with VBA in Access!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top