Results 1 to 10 of 10

Thread: multiple windows open while running the executable application.

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 2006
    Posts
    46

    Unhappy multiple windows open while running the executable application.

    hi,
    when i compiled my application and ran the .exe i find multiple windows open on my status bar.
    i have used form.hide in many forms as it wasn't working when i used form.close. so this might be the reason why its showing me all these windows.
    is there a way to solve this problem.please need urgent help.if anyone can help i would very much appreciate it.
    thanks.

  2. #2
    Member
    Join Date
    Jan 2006
    Posts
    53

    Re: multiple windows open while running the executable application.

    What version of Visual Studio do you use?

    I'm using 2005, and when I use the Hide method on a form, it does not appear in my task bar.

  3. #3
    PowerPoster stanav's Avatar
    Join Date
    Jul 2006
    Location
    Providence, RI - USA
    Posts
    9,290

    Re: multiple windows open while running the executable application.

    Instead of hide the main form, you set its visibled property to false
    VB Code:
    1. Dim frm As New Form2 'Create a new instance of Form2
    2.         frm.Show() 'Show it
    3.         Me.Visible = False 'Set the visibled property of the main form to False
    Then when you done showing form, to close the application, you call
    VB Code:
    1. Application.Exit() 'Instead of Me.Close()

  4. #4
    Arabic Poster ComputerJy's Avatar
    Join Date
    Nov 2005
    Location
    Happily misplaced
    Posts
    2,513

    Re: multiple windows open while running the executable application.

    Quote Originally Posted by Lanmou
    hi,
    when i compiled my application and ran the .exe i find multiple windows open on my status bar.
    i have used form.hide in many forms as it wasn't working when i used form.close. so this might be the reason why its showing me all these windows.
    is there a way to solve this problem.please need urgent help.if anyone can help i would very much appreciate it.
    thanks.
    Don't Create forms until you need them, it's improper use of resources to do that
    "I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
    My Blog

  5. #5
    Arabic Poster ComputerJy's Avatar
    Join Date
    Nov 2005
    Location
    Happily misplaced
    Posts
    2,513

    Re: multiple windows open while running the executable application.

    Quote Originally Posted by stanav
    Instead of hide the main form, you set its visibled property to false
    The Hide() method implicitly sets the Visible property to False
    Quote Originally Posted by stanav
    Then when you done showing form, to close the application, you call Application.Exit() Instead of Me.Close()
    Closing the Main form will also cause the application to Exit
    "I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
    My Blog

  6. #6
    PowerPoster JuggaloBrotha's Avatar
    Join Date
    Sep 2005
    Location
    Lansing, MI; USA
    Posts
    4,286

    Re: multiple windows open while running the executable application.

    stay away from Application.Exit because when it closes the forms, the Closing and Closed events dont fire, so if there's cleanup code to be done, the code wont run
    Currently using VS 2015 Enterprise on Win10 Enterprise x64.

    CodeBank: All ThreadsColors ComboBoxFading & Gradient FormMoveItemListBox/MoveItemListViewMultilineListBoxMenuButtonToolStripCheckBoxStart with Windows

  7. #7
    PowerPoster stanav's Avatar
    Join Date
    Jul 2006
    Location
    Providence, RI - USA
    Posts
    9,290

    Re: multiple windows open while running the executable application.

    Quote Originally Posted by ComputerJy
    The Hide() method implicitly sets the Visible property to False
    Closing the Main form will also cause the application to Exit
    The original poster wants to do something like:
    startup form > Next > next > Next > Finish
    So he has to hide the startup form and show the next form. Suppose now he's at the Finish form, Me.Close() will close only the Finish form leaving the startup form still running invisibly. That's why Application.Exit() is more appropriate in this case.

  8. #8
    Arabic Poster ComputerJy's Avatar
    Join Date
    Nov 2005
    Location
    Happily misplaced
    Posts
    2,513

    Re: multiple windows open while running the executable application.

    Quote Originally Posted by JuggaloBrotha
    stay away from Application.Exit because when it closes the forms, the Closing and Closed events dont fire, so if there's cleanup code to be done, the code wont run
    I believe this was fixed in VS2005
    "I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
    My Blog

  9. #9
    Arabic Poster ComputerJy's Avatar
    Join Date
    Nov 2005
    Location
    Happily misplaced
    Posts
    2,513

    Re: multiple windows open while running the executable application.

    Quote Originally Posted by stanav
    The original poster wants to do something like:
    startup form > Next > next > Next > Finish
    So he has to hide the startup form and show the next form. Suppose now he's at the Finish form, Me.Close() will close only the Finish form leaving the startup form still running invisibly. That's why Application.Exit() is more appropriate in this case.
    In this case it's better to use panels
    "I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
    My Blog

  10. #10
    Lively Member
    Join Date
    Aug 2006
    Posts
    86

    Re: multiple windows open while running the executable application.

    hi
    thanks everyone for all your suggestions
    Iam using visual basic 2003,version 7.1.3088

    i tried doing couple of things but still the windows appear in the task bar.
    tried Me.ShowInTaskbar = False after me.hide. doesn't work.

    In my application i call forms from other forms so tried doing this too


    VB Code:
    1. Me.Hide()
    2.                 Me.ShowInTaskbar = False
    3.                  Dim frmnewdatamain As New frmDataMain
    4.                 frmnewdatamain.ShowDialog()
    5.                 frmnewdatamain.ShowInTaskbar = False
    not working..

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