|
-
Oct 16th, 2006, 01:23 PM
#1
Thread Starter
Member
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.
-
Oct 16th, 2006, 01:31 PM
#2
Member
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.
-
Oct 16th, 2006, 01:35 PM
#3
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()
-
Oct 16th, 2006, 01:35 PM
#4
Re: multiple windows open while running the executable application.
 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
-
Oct 16th, 2006, 01:39 PM
#5
Re: multiple windows open while running the executable application.
 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
 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
-
Oct 16th, 2006, 01:42 PM
#6
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
-
Oct 16th, 2006, 01:51 PM
#7
Re: multiple windows open while running the executable application.
 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.
-
Oct 16th, 2006, 01:51 PM
#8
Re: multiple windows open while running the executable application.
 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
-
Oct 16th, 2006, 04:51 PM
#9
Re: multiple windows open while running the executable application.
 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
-
Oct 16th, 2006, 08:49 PM
#10
Lively Member
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..
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|