|
-
Feb 2nd, 2003, 08:00 PM
#1
Thread Starter
Addicted Member
Checking if a form is active?
How can I check to see if a form is active?
-
Feb 3rd, 2003, 03:58 AM
#2
PowerPoster
what do you mean by "Active"..Visible?
-We have enough youth. How about a fountain of "Smart"?
-If you can read this, thank a teacher....and since it's in English, thank a soldier.

-
Feb 3rd, 2003, 01:34 PM
#3
Thread Starter
Addicted Member
-
Feb 3rd, 2003, 02:17 PM
#4
Hyperactive Member
If you want to see if a form is visible, just check the visible flag 
If Form1.Visible Then Do Whatever
if you want to see if the form is loaded just do a..
If Not Form1 Is Nothing Then Do Whatever
-
Feb 3rd, 2003, 02:19 PM
#5
Sleep mode
Originally posted by Hinder
If you want to see if a form is visible, just check the visible flag 
If Form1.Visible Then Do Whatever
if you want to see if the form is loaded just do a..
If Not Form1 Is Nothing Then Do Whatever
something like this :
VB Code:
Dim frm2 As New Form2()
If frm2.Visible = True Then
MsgBox("Form 2 is Visible")
Else
MsgBox("Form 2 is not Visible")
End If
-
Feb 3rd, 2003, 02:20 PM
#6
Sleep mode
huh , too late .Hinder solved it !
-
Feb 4th, 2003, 12:18 PM
#7
Thread Starter
Addicted Member
This is what is in my program right now:
Code:
Private Sub FileSystemWatcher1_Changed(ByVal sender As System.Object, ByVal e As System.IO.FileSystemEventArgs) Handles FileSystemWatcher1.Changed
Dim frm1 As New Form1()
If frm1.Visible = False Then
frm1.Visible = True
End If
End Sub
When the filesystemwatcher is invoked more than one time I still end up with a bunch of forms.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|