Results 1 to 6 of 6

Thread: [2005] How to hide a form when Minimized

  1. #1

    Thread Starter
    Member
    Join Date
    Dec 2007
    Location
    Indonesia
    Posts
    56

    [2005] How to hide a form when Minimized

    Dear All,

    I have one question. Hopely you have the answer about my question. My question is when i minimized my form only show the icon in the taskbar. Do you have solution about my question. Thanks...

    Regards
    Hiesan

  2. #2
    Frenzied Member
    Join Date
    Dec 2007
    Posts
    1,072

    Re: [2005] How to hide a form when Minimized

    Minimizing to the system tray?

  3. #3
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2005] How to hide a form when Minimized

    vb.net Code:
    1. Private Sub Form1_SizeChanged(ByVal sender As Object, _
    2.                               ByVal e As EventArgs) Handles Me.SizeChanged
    3.     If Me.WindowState = FormWindowState.Minimized Then
    4.         Me.NotifyIcon1.Visible = True
    5.         Me.ShowInTaskbar = False
    6.     Else
    7.         Me.NotifyIcon1.Visible = False
    8.         Me.ShowInTaskbar = True
    9.     End If
    10. End Sub
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  4. #4

    Thread Starter
    Member
    Join Date
    Dec 2007
    Location
    Indonesia
    Posts
    56

    Re: [2005] How to hide a form when Minimized

    Ok thanks so much...............

  5. #5
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2005] How to hide a form when Minimized

    You would also probably want to handle the DoubleClick event of the NotifyIcon and set the WindowState of the form to Normal. That would cause the SizeChanged event to be raised, thus executing the code to hide the tray icon and reinstate the task bar button.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  6. #6
    Hyperactive Member mrmojorisin's Avatar
    Join Date
    Oct 2007
    Location
    London Town Vocation: Garden Cricket Genuis
    Posts
    439

    Re: [2005] How to hide a form when Minimized

    Cool

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