Results 1 to 8 of 8

Thread: New form on taskbar?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Dec 2004
    Posts
    129

    Question New form on taskbar?

    I have 2 forms. when a button is clicked form1 loads form2. I have that button hide form1 when opening form2 but where the forms show on the taskbar jumps around and you caln see a form being shown and one being hiden. How can i make this smooth without looking like forms are changing on the taskbar. this is an eaxmple of what i am trying..

    Private Sub CmdButton_Click()
    form1.hide
    form2.show
    End Sub

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: New form on taskbar?

    If you have any code in form2's load event which Shows the form this won't work quite as well, but code like this should be smoother changeover:
    VB Code:
    1. Private Sub CmdButton_Click()
    2. Load form2
    3. form1.hide
    4. form2.show
    5. End Sub

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Dec 2004
    Posts
    129

    Re: New form on taskbar?

    Quote Originally Posted by si_the_geek
    If you have any code in form2's load event which Shows the form this won't work quite as well, but code like this should be smoother changeover:
    VB Code:
    1. Private Sub CmdButton_Click()
    2. Load form2
    3. form1.hide
    4. form2.show
    5. End Sub

    I have tried that and it doesnt seem to make a difference. I ahve seen other VB apps that are seemless and i am not sure how they do it

  4. #4
    New Member mwpickle's Avatar
    Join Date
    Nov 2005
    Location
    Australia
    Posts
    15

    Re: New form on taskbar?

    I don't exactly now what you are trying to do but heres the code I think your looking for.

    VB Code:
    1. Private Sub CmdButton_Click()
    2. Load Form2
    3. Form1.Hide
    4. Form2.Show
    5. Form2.Caption = Form1.Caption
    6. Form2.Left = Form1.Left
    7. Form2.Top = Form1.Top
    8. End Sub

  5. #5
    Fanatic Member neicedover1982's Avatar
    Join Date
    Jun 2005
    Posts
    566

    Re: New form on taskbar?

    I do this in one of my games. What I do is I set a form with a border and then all the other forms open up (with no border) positioned directly over the other form. This way there is only 1 label in the taskbar and I can keep it from flickering when forms change.
    Kevin | New England Iced Over | http://www.kevincawleyjr.com

  6. #6
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: New form on taskbar?

    Quote Originally Posted by SllX
    I have 2 forms. when a button is clicked form1 loads form2. I have that button hide form1 when opening form2 but where the forms show on the taskbar jumps around and you caln see a form being shown and one being hiden. How can i make this smooth without looking like forms are changing on the taskbar. ...
    I don't think I even understand what you're after so can you ellaborate please? Do you want Form2 to be shown in Taskbar or not?

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Dec 2004
    Posts
    129

    Re: New form on taskbar?

    Quote Originally Posted by RhinoBull
    I don't think I even understand what you're after so can you ellaborate please? Do you want Form2 to be shown in Taskbar or not?

    When i switch back and fortth from form1 and form2 i want the active form to show on the taskbar.

  8. #8

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