Results 1 to 22 of 22

Thread: [2008] Message box help

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Mar 2006
    Posts
    242

    Exclamation [2008] Message box help

    I made a right click menu but i named a button there close so before article is closed i want message box to show and ask are you sure you want to exit..


    can some one help me on this..?!

    also for the code to make the article exit at all and close the Notification icon also...
    Last edited by TetovaBoy; Oct 5th, 2008 at 06:31 PM.
    < advertising link removed by moderator >

  2. #2
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,424

    Re: [2008] Message box help

    try this:

    vb Code:
    1. If MessageBox.Show("Are you sure you want to exit?", "Exit?.....", MessageBoxButtons.OKCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly, False) = DialogResult.OK Then
    2.    Application.Exit()
    3. End If

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Mar 2006
    Posts
    242

    Re: [2008] Message box help

    thanks mate but the system try icon still dont hides...!!!
    < advertising link removed by moderator >

  4. #4
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,424

    Re: [2008] Message box help

    move your mouse over it. does it disappear?

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Mar 2006
    Posts
    242

    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
    < advertising link removed by moderator >

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Mar 2006
    Posts
    242

    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..?!
    < advertising link removed by moderator >

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Mar 2006
    Posts
    242

    Re: [2008] Message box help

    i fixed thanks for your helps..
    < advertising link removed by moderator >

  8. #8
    Lively Member
    Join Date
    Jan 2007
    Posts
    96

    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.

  9. #9
    Lively Member
    Join Date
    Jan 2007
    Posts
    96

    Re: [2008] Message box help

    double post. sorry.

  10. #10

    Thread Starter
    Addicted Member
    Join Date
    Mar 2006
    Posts
    242

    Re: [2008] Message box help

    do not works
    < advertising link removed by moderator >

  11. #11
    Lively Member
    Join Date
    Jan 2007
    Posts
    96

    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.

  12. #12

    Thread Starter
    Addicted Member
    Join Date
    Mar 2006
    Posts
    242

    Re: [2008] Message box help

    nope mate can u upload my project u download and check.>?!

    because not working...
    < advertising link removed by moderator >

  13. #13
    Lively Member
    Join Date
    Jan 2007
    Posts
    96

    Re: [2008] Message box help

    upload it and ill check it out.

  14. #14
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,424

    Re: [2008] Message box help

    you said you've fixed it in post #7

  15. #15

    Thread Starter
    Addicted Member
    Join Date
    Mar 2006
    Posts
    242

    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
    < advertising link removed by moderator >

  16. #16

    Thread Starter
    Addicted Member
    Join Date
    Mar 2006
    Posts
    242

    Re: [2008] Message box help

    here is the link download an check it up please..

    http://www.mxupload.com/ecbhlci6s90n...hv1.9.rar.html
    < advertising link removed by moderator >

  17. #17

    Thread Starter
    Addicted Member
    Join Date
    Mar 2006
    Posts
    242

    Re: [2008] Message box help

    can u check this now and help me..?!
    < advertising link removed by moderator >

  18. #18
    Frenzied Member
    Join Date
    Sep 2006
    Location
    Scotland
    Posts
    1,054

    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.

  19. #19

    Thread Starter
    Addicted Member
    Join Date
    Mar 2006
    Posts
    242

    Re: [2008] Message box help

    i know when i remove it it works

    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..!!
    < advertising link removed by moderator >

  20. #20
    Frenzied Member
    Join Date
    Sep 2006
    Location
    Scotland
    Posts
    1,054

    Re: [2008] Message box help

    Im not sure what you mean?

  21. #21
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,424

    Re: [2008] Message box help

    sounds easy enough. post it on the forum

  22. #22
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,424

    Re: [2008] Message box help

    Quote Originally Posted by TetovaBoy
    i know when i remove it it works

    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.

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