Close button problem in vb.net(windows application)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • somtabu
    New Member
    • Nov 2006
    • 15

    Close button problem in vb.net(windows application)

    hello, i have a problem in vb.net windows application,
    verson is 2005 and framework is 2.0

    I want to close a form by using the close button which is right hand top side of the window. i want, when i click the close button a dialog box appear and ask me "Are you sure you want to Quit?" and there is 2 button (Yes and No).... if i click "Yes" button then the form is closed and if i click the "No" button then dialog box should be close.....

    Actually i have done little bit.... after clicking the close button, dialog box is appear.... after that when i click "Yes" butoon, the form is closed also same with the "No" button.....

    Please help me......

    Thank You....
  • JosAH
    Recognized Expert MVP
    • Mar 2007
    • 11453

    #2
    Hi, you should've posted your question in the .NET Forum section, not here in the
    .NET Articles section; I've moved your post for you.

    kind regards,

    Jos

    Comment

    • azadur
      New Member
      • Oct 2007
      • 5

      #3
      when you raise the form closing event set the e.cancel = true if yes. that way the close event is cancelled and the form stays open
      the e.cancel=false will make the form close. this is the default value

      Comment

      Working...