DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 5 of 5

Thread: Checking form status

  1. #1
    Join Date
    Dec 2004
    Posts
    717

    Checking form status

    Hello,

    There are there forms [frmMain,frm1,frm2] in my application [vb.net].
    How can I check one Form has been loaded or not from frmMain?

    Any help would be appreciated.
    Best Regards,
    Michael Sync
    http://michaelsync.net

    The more you share,The more you get

  2. #2
    Join Date
    Mar 2005
    Location
    Los Angeles, Calif. AKA: Gangsta Yoda™
    Posts
    455
    One way is by using TypeName
    Code:
    If TypeName(frm1) <> "Nothing" Then
        MessageBox.Show("Loaded!")
    Else
        MessageBox.Show("Not Loaded!")
    End If
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer code questions via PMs.
    Microsoft MVP 2006-2009
    Office Development FAQ (VBA, VB6, VB.NET, C#)
    Software Engineer MCP (VB6 & .NET)
    Reps & Rating PostsVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6Outlook Global Address List

  3. #3
    Join Date
    Dec 2004
    Posts
    717
    I can't. How should i do?:-(
    Best Regards,
    Michael Sync
    http://michaelsync.net

    The more you share,The more you get

  4. #4
    Join Date
    Mar 2005
    Posts
    71
    The simplest way to do this is using a static (shared) variable as flag.
    Set it to false on default and turn it to true on the form load event.

  5. #5
    Join Date
    Dec 2004
    Posts
    717
    Thanks.oupoi.
    Actually, we can use global variable in module. I don't want to use like that.
    Because, If we have many forms, we will need to declare many variable.I think it is not good for performance.
    In V6, I think we can use "App.PrevInstance".
    Best Regards,
    Michael Sync
    http://michaelsync.net

    The more you share,The more you get

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center