Results 1 to 3 of 3

Thread: Form1.activate after form1.visible=false

  1. #1
    Guest

    Talking

    Hoi folks, i have some typical newby questions
    After declaring Forms2.visible=false,
    i noticed that forms1.activate runs.
    ( forms2 is set visible from within forms1,
    forms2.visible=false is declared in forms2 )
    Is that normal ?
    How can i prevent that ?
    Why do i see 2 entry's in the taskbar ?
    Do i really have to read my tutorial from the start
    instead of reading backwards ? :<)



  2. #2
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    Form1 code..

    Form1.Visible = False
    Form2.Visible = True

    Form2 code..
    Form2.Visible = False
    Form1.Visible = True
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  3. #3
    Addicted Member Shrog's Avatar
    Join Date
    Aug 1999
    Location
    Darkest Africa
    Posts
    186

    Talking

    Form1 is the active form. Then you show Form2 and Form2 becomes the active form. This means that the Deactivate event for Form1 should happen, and the Activate event for Form2 should happen. Now when you make Form2 invisible, Windows has to pick another form to make the active form. Why not the one that was active last? So windows will make Form1 the active form again, and that is where the Activate event happens.

    The only way you can stop it is to make sure that windows selects a different form to be the active form when Form2 is hidden. You can do this by making Form1 invisible or minimized before Form2 becomes invisible.

    Hope this helps.
    Shrog

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