Results 1 to 7 of 7

Thread: how to check the form's visible status?

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Feb 2000
    Location
    Mumbai,Maharashtra,India
    Posts
    19

    Question

    How to check whether a form is loaded or no after it has been hidden using hide method.

    AS FAST AS POSSIBLE

    Eswar

  2. #2
    Guest
    Why don't you set a bool variable to true in the form's load procedure.. then you could check that variable if it is true, it is loaded, if not, then it isn't...

  3. #3
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    You can set the Me.tag to hid or shown and check that.

  4. #4
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    The form won't unload with hide method, if it's not loaded then it will actually load.
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  5. #5
    PowerPoster Chris's Avatar
    Join Date
    Jan 1999
    Location
    K-PAX
    Posts
    3,238

    Wink

    Juz use the FindWindow API will do.

    Code:
    Option Explicit
    Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As Long, ByVal lpWindowName As String) As Long
    
    Private Sub Command1_Click()
        Load Form2
    End Sub
    
    Private Sub Command2_Click()
        Form2.Show
    End Sub
    
    Private Sub Command3_Click()
        Form2.Hide
    End Sub
    
    Private Sub Command4_Click()
    Dim handle As Long
    
    handle = FindWindow(0, "Form2")
    If handle <> 0 Then
        If Not Form2.Visible Then
            MsgBox "Form2 is loaded but not visible."
        Else
            MsgBox "Form2 is loaded and is visible to all."
        End If
    Else
        MsgBox "Form2 is not loaded"
    End If
    End Sub
    Cheers!

  6. #6
    Fanatic Member faisalkm's Avatar
    Join Date
    Oct 2000
    Location
    Germany
    Posts
    752
    The hide method does not unload the form.
    Faisal Muhammed
    Homepage:I Started making it in 1994 ...Still Under Construction
    Using

    Visual Basic 6.0 Enterprise SP5
    Embedded Visual Basic 3.0
    SQL Server 2000
    Windows 2000 Proff
    Delphi 6.0


    Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

  7. #7
    PowerPoster Chris's Avatar
    Join Date
    Jan 1999
    Location
    K-PAX
    Posts
    3,238
    yes, faisalkm. Hide will not unload the form. As from the name hide mean set the form to invisible.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width