|
-
Mar 5th, 2014, 05:13 AM
#1
[RESOLVED] Main form not visible means it's not available when Alt/Tabbing
A project's main form is Form1 and eventually Form2 is loaded following a button click,
Form2.Show 1
I thought I'd make the main form invisible until control be returned to it by inserting another 2 statements:
Me.Visible = False
Form2.Show 1
Me.Visible = True
But then, with Form2 already loaded, I tried to cycle through some other applications I was running at the same time by hitting Alt/Tab, but it turned out the VB application was hidden and couldn't be selected, all because of those 2 Me.Visible statements above.
I wonder if there's a way to circumvent this inconvenience. Not that I absolutely need to hideForm1 but I'm curious to know.
Lottery is a tax on people who are bad at maths
If only mosquitoes sucked fat instead of blood...
To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)
-
Mar 5th, 2014, 05:25 AM
#2
Re: Main form not visible means it's not available when Alt/Tabbing
Last edited by Zvoni; Tomorrow at 31:69 PM.
----------------------------------------------------------------------------------------
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------------------
People call me crazy because i'm jumping out of perfectly fine airplanes.
---------------------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad
-
Mar 5th, 2014, 06:23 AM
#3
Re: Main form not visible means it's not available when Alt/Tabbing
 Originally Posted by Zvoni
In my case showing the form modal does not make the difference. Simply removing the Me.Visible statements makes the application available in the task list.
Lottery is a tax on people who are bad at maths
If only mosquitoes sucked fat instead of blood...
To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)
-
Mar 5th, 2014, 10:54 AM
#4
Re: Main form not visible means it's not available when Alt/Tabbing
Give this a try. In Form1 remove the line that is setting visiblity to false
Code:
'Me.Visible = False
Form2.Show 1
Me.Visible = True
In the Activate event of Form2 set visibility to false for Form1.
Code:
Private Sub Form_Activate()
Form1.Visible = False
End Sub
-
Mar 5th, 2014, 11:41 AM
#5
Re: Main form not visible means it's not available when Alt/Tabbing
 Originally Posted by MarkT
Give this a try...
Yes, it works! Thank you.
Lottery is a tax on people who are bad at maths
If only mosquitoes sucked fat instead of blood...
To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)
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
|