Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Minimize button

Minimize button

Scheduled Pinned Locked Moved Visual Basic
questionhelp
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • X Offline
    X Offline
    Xanty
    wrote on last edited by
    #1

    Hi! I would like to know how can i, pressing the form's minimize button, run a function of mine that makes the aplication to run in the system tray, this last part is done, i just can't find anything that allows me to catch the minimize button event. Can anyone help me? Thank you for your time

    S A 2 Replies Last reply
    0
    • X Xanty

      Hi! I would like to know how can i, pressing the form's minimize button, run a function of mine that makes the aplication to run in the system tray, this last part is done, i just can't find anything that allows me to catch the minimize button event. Can anyone help me? Thank you for your time

      S Offline
      S Offline
      SimonS
      wrote on last edited by
      #2

      Try this:

      Private Sub Test(ByVal sender As System.Object, ByVal e As System.EventArgs)
                   Handles MyBase.Resize
      
          If Me.WindowState = FormWindowState.Minimized Then
              MsgBox("Worked")
          End If
      
      
      End Sub
      

      Let me know if this helps. Cheers, Simon "The day I swan around in expensive suits is the day I hope someone puts a bullet in my head.", Chris Carter. animation mechanics in SVG

      1 Reply Last reply
      0
      • X Xanty

        Hi! I would like to know how can i, pressing the form's minimize button, run a function of mine that makes the aplication to run in the system tray, this last part is done, i just can't find anything that allows me to catch the minimize button event. Can anyone help me? Thank you for your time

        A Offline
        A Offline
        Anomaly1024
        wrote on last edited by
        #3

        Try this: Private Sub Form1_Deactivate(ByVal sender As System.Object, ByVal e As _ System.EventArgs) Handles MyBase.Deactivate If Me.WindowState = FormWindowState.Minimized Then Me.Hide() End If End Sub Or if you already have a function of your own then simply replace the Me.Hide() part and you are in business. Good Luck :cool:

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups