Results 1 to 5 of 5

Thread: [RESOLVED] Main form not visible means it's not available when Alt/Tabbing

  1. #1

    Thread Starter
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573

    Resolved [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)

  2. #2
    PowerPoster Zvoni's Avatar
    Join Date
    Sep 2012
    Location
    To the moon and then left
    Posts
    5,268

    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

  3. #3

    Thread Starter
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573

    Re: Main form not visible means it's not available when Alt/Tabbing

    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)

  4. #4
    PowerPoster
    Join Date
    Jun 2001
    Location
    Trafalgar, IN
    Posts
    4,141

    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

  5. #5

    Thread Starter
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573

    Re: Main form not visible means it's not available when Alt/Tabbing

    Quote Originally Posted by MarkT View Post
    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
  •  



Click Here to Expand Forum to Full Width