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.
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.
Re: multiple windows open while running the executable application.
Instead of hide the main form, you set its visibled property to false
VB Code:
Dim frm As New Form2 'Create a new instance of Form2
frm.Show() 'Show it
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:
Application.Exit() 'Instead of Me.Close()
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
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
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
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.
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
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
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:
Me.Hide()
Me.ShowInTaskbar = False
Dim frmnewdatamain As New frmDataMain
frmnewdatamain.ShowDialog()
frmnewdatamain.ShowInTaskbar = False
not working..