Minimize button
-
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
-
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
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
-
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
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: