exit command

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • enrico via DotNetMonster.com

    exit command

    i created an exitstrip tool on my system and i want my system to ask the user
    if he/she really wants to exit the application. but when i add a command on
    the forms close button my exitstrip tool doesn't work well. this is my
    command on my exitstrip tool:

    Private Sub ExitToolStripMe nuItem1_Click(B yVal sender As System.Object, ByVal
    e As System.EventArg s) Handles ExitToolStripMe nuItem1.Click
    Flag = True
    If MessageBox.Show ("Do you really want to exit this application?", "",
    MessageBoxButto ns.YesNo) = Windows.Forms.D ialogResult.Yes Then
    Me.Close()
    Else
    TextBox3.Focus( )
    End If
    End Sub

    and this is my command on my close button:

    Private Sub Form3_FormClosi ng(ByVal sender As System.Object, ByVal e As
    System.Windows. Forms.FormClosi ngEventArgs) Handles MyBase.FormClos ing
    If MessageBox.Show ("Do you really want to exit this application?", "",
    MessageBoxButto ns.YesNo) = Windows.Forms.D ialogResult.No Then
    e.Cancel = True
    End If
    End Sub

    is there something wrong on my codes?

    --
    Message posted via DotNetMonster.c om
    Best online pokies for real money in Australia and learn about safety and game mechanics in this comprehensive guide.


  • kimiraikkonen

    #2
    Re: exit command

    On Mar 18, 3:35 am, "enrico via DotNetMonster.c om" <u41845@uwewrot e:
    i created an exitstrip tool on my system and i want my system to ask the user
    if he/she really wants to exit the application. but when i add a command on
    the forms close button my exitstrip tool doesn't work well. this is my
    command on my exitstrip tool:
    >
    Private Sub ExitToolStripMe nuItem1_Click(B yVal sender As System.Object, ByVal
    e As System.EventArg s) Handles ExitToolStripMe nuItem1.Click
    Flag = True
    If MessageBox.Show ("Do you really want to exit this application?", "",
    MessageBoxButto ns.YesNo) = Windows.Forms.D ialogResult.Yes Then
    Me.Close()
    Else
    TextBox3.Focus( )
    End If
    End Sub
    >
    and this is my command on my close button:
    >
    Private Sub Form3_FormClosi ng(ByVal sender As System.Object, ByVal e As
    System.Windows. Forms.FormClosi ngEventArgs) Handles MyBase.FormClos ing
    If MessageBox.Show ("Do you really want to exit this application?", "",
    MessageBoxButto ns.YesNo) = Windows.Forms.D ialogResult.No Then
    e.Cancel = True
    End If
    End Sub
    >
    is there something wrong on my codes?
    >
    --
    Message posted via DotNetMonster.c omhttp://www.dotnetmonst er.com/Uwe/Forums.aspx/dotnet-vb-net/200803/1
    Your code works fine without "Flag = True" code line. What's your
    problem by calling "doesn't work" ?

    Comment

    Working...