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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to find out if a form is opened? 2

Status
Not open for further replies.

pierrotsc

Programmer
Nov 25, 2007
358
US
I am trying to find out if i can tell if a form is opened. I tried if palettef.showing then,
if palettef.enabled then ,
if palettef.active then

But i get an error if the palettef form is not opened.
Anybosy got an idea?
Thanks.
Pierrotsc
 
check if form is created:
if form2 = nil then
do something...

check if form is visible:
if form2.visible then
do something...


Aaron
 
Thanks man. I was missing the nil...I did change it to if form2<>nil to find out if it was created.
PO
 
Standard check if you work with on the fly objects:

Code:
if Assigned(Object) then
 DoSomethingWith(Object)

so in your case:

if Assigned(Form2) then
 if Form2.Visible then 
   ...

/Daddy

-----------------------------------------------------
What You See Is What You Get
Never underestimate tha powah of tha google!
 
Thanks. I learned something new...I just updated my code.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top