[Help] Form Closing [solved]

Posts 1–9 of 9 · Page 1 of 1
[Help] Form Closing [solved]
How do you make it so if someone trys the close the program (presses X), it puts it in tray?

Like...

Code:
Private Sub Form2_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
                Me.hide()
                Me.Closing = False 'Something that would work...
    End Sub
Code:
Me.WindowState = FormWindowState.Minimized 

Me.ShowInTaskbar = False
Add A Notify icon to ur form and enable it.
Quote Originally Posted by SubCub View Post
Code:
Me.WindowState = FormWindowState.Minimized 

Me.ShowInTaskbar = False
Add A Notify icon to ur form and enable it.
It still closes though, you till it to minimize, then it closes. I want to know how to stop it from closing...
Show make it show in tray while being opened?
Quote Originally Posted by SubCub View Post
Show make it show in tray while being opened?
So, I want it to stay open, but in tray when they press X to close it. Form1 gets data from form2, and if form2 is closed, it cant get the data from it. So form2 has to stay open, but in tray.
So dont close and just directly move to tray?

Quote Originally Posted by Cryptonic View Post
How do you make it so if someone trys the close the program (presses X), it puts it in tray?

Like...

Code:
Private Sub Form2_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
                Me.hide()
                Me.Closing = False 'Something that would work...
    End Sub
Come to think after looking i could do it but im lazy so maybe ill do it for u...
Try

e.cancel = true
Quote Originally Posted by Blubb1337 View Post
Try

e.cancel = true
It worked perfectly. Thanks.

/Solved
Good jab kevin

Thread marked solved, no moar posting!
Posts 1–9 of 9 · Page 1 of 1
This thread is closed for replies.

Tags for this Thread

None

Talk with us