Quello guarda solo se il form è attivo!

codice:
If form1.visible = true then 'E' aperto