Results 1 to 3 of 3

Thread: Preventing multiple forms from loading?

  1. #1

    Thread Starter
    Fanatic Member Graff's Avatar
    Join Date
    Jan 2002
    Location
    Calgary
    Posts
    668

    Preventing multiple forms from loading?

    On my mnuAbout click event I have the following.

    Dim fAbout as New frmAbout
    fAbout.Show

    if the user keeps clicking mnuabout it will keep loading new forms. How do I prevent more than just one?
    If wishes were fishes we'd all cast nets.

  2. #2
    Hyperactive Member CyberHawke's Avatar
    Join Date
    May 2004
    Location
    Washington DC
    Posts
    477
    VB Code:
    1. Private fAbout As frmAbout 'Declare at form level
    2. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    3.     If fAbout Is Nothing Then
    4.         fAbout = New frmAbout
    5.         fAbout.Show()
    6.     End If
    7. End Sub

  3. #3

    Thread Starter
    Fanatic Member Graff's Avatar
    Join Date
    Jan 2002
    Location
    Calgary
    Posts
    668
    Hmmm that sorta works but now how to make fabout = nothing when the form is closed?
    Last edited by Graff; Jun 22nd, 2004 at 01:22 PM.
    If wishes were fishes we'd all cast nets.

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