[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.
Re: Main form not visible means it's not available when Alt/Tabbing
Re: Main form not visible means it's not available when Alt/Tabbing
Quote:
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.
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
Re: Main form not visible means it's not available when Alt/Tabbing
Quote:
Originally Posted by
MarkT
Give this a try...
Yes, it works! Thank you.