i am trying to test if a form is open or not, i thought the following was working:

if frmname.isdiposed = false then call frmname.somefunction

but it doesnt work like i thought it did

basically what im trying to do is determine if a form is open or closed, if its open call a function on the form. if it is closed don't do anything

thanks in advance.

How did initialized the form before calling the isdisposed() function?
Can you put it here the whole code of that function you are created.

You could use the following:

If Frmmain.Visible = False then
Call frmmain.function
End If

Find more at www.ITHelps.info

Edited 6 Years Ago by BlueCharge: n/a

i was thinking of doing that, just wasnt sure if there was a better way or not.

i have been using the if form1.created = true then dowhatever

it seems to be working i may just stick with that not sure.
thanks for your input.

From the MSDN article:

Dispose will be called automatically if the form is shown using the Show method. If another method such as ShowDialog is used, or the form is never shown at all, you must call Dispose yourself within your application.

This article has been dead for over six months. Start a new discussion instead.