Re: [2008] Message box help
try this:
vb Code:
If MessageBox.Show("Are you sure you want to exit?", "Exit?.....", MessageBoxButtons.OKCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly, False) = DialogResult.OK Then
Application.Exit()
End If
Re: [2008] Message box help
thanks mate but the system try icon still dont hides...!!!
Re: [2008] Message box help
move your mouse over it. does it disappear?
Re: [2008] Message box help
nope it donts still it uses even the right click menu
again i do same click exit on it asks the box i click yah
from desktop the panel exits but on system try its icon stays
Re: [2008] Message box help
Code:
Private Sub Form1_FormClosing(ByVal sender As System.Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing
e.Cancel = True
Me.Hide()
End Sub
i used this for x maybe do u think this can do not let it exit at all..?!
Re: [2008] Message box help
i fixed thanks for your helps..:D
Re: [2008] Message box help
Code:
If MessageBox.Show("Do you really want to exit", "Exit?", MessageBoxButtons.YesNo) = Windows.Forms.DialogResult.Yes Then Application.Exit()
Should work for you.
Re: [2008] Message box help
Re: [2008] Message box help
Re: [2008] Message box help
Code:
If MessageBox.Show("Do you really want to exit", "Exit?", MessageBoxButtons.YesNo) = Windows.Forms.DialogResult.Yes Then Application.Exit()
Works perfectly for me. Do this:
Code:
Try
If MessageBox.Show("Do you really want to exit", "Exit?", MessageBoxButtons.YesNo) = Windows.Forms.DialogResult.Yes Then Application.Exit()
Catch ex As Exception
MessageBox.Show(ex.ToString)
End Try
See if that spits out an error for you. If so, copy the messagebox text and paste it here so we know what the problem is. That code should def be working for you though.
Re: [2008] Message box help
nope mate can u upload my project u download and check.>?!
because not working...
Re: [2008] Message box help
upload it and ill check it out.
Re: [2008] Message box help
you said you've fixed it in post #7
Re: [2008] Message box help
i fixed as i delete this code
Code:
Private Sub Form1_FormClosing(ByVal sender As System.Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing
e.Cancel = True
Me.Hide()
End Sub
Re: [2008] Message box help
Re: [2008] Message box help
can u check this now and help me..?!
Re: [2008] Message box help
If you remove this:
Code:
e.Cancel = True
Me.Hide()
then that should make it exit. Replace it with code to unload all your objects. (I cant test it as I dont have the same controls installed.)
And just for future reference you can zip it up and host it on the forum its self. And if its too large (500k is the limit for a zipped folder i think), then please don't use a site you need to register with in order to download.
Re: [2008] Message box help
i know when i remove it it works :D
but can u tell me how 2 make when user click x the x on window how cna i make else the article go down on system try and when user right clicks and selects exit the Application to exit..!!
Re: [2008] Message box help
Im not sure what you mean?
Re: [2008] Message box help
sounds easy enough. post it on the forum
Re: [2008] Message box help
Quote:
Originally Posted by TetovaBoy
i know when i remove it it works :D
but can u tell me how 2 make when user click x the x on window how cna i make else the article go down on system try and when user right clicks and selects exit the Application to exit..!!
you need to set a form level boolean flag to check why the form is attempting to close. upload your project to the forum and i'll have another look.