how can i exit from the form after clicking the "yes" button of a messageBox??
samehere -3 Newbie Poster
Recommended Answers
Jump to PostDo not expect us to guess and solve your problem.
What is the code that you are working on ?
Jump to Postare you really don't know how to do it?
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim msg As MsgBoxResult If MsgBox("Do you really want to exit ?", MsgBoxStyle.YesNo, "Exit") = msg.Yes Then Me.Close() End If End Sub
Jump to PostIts depends on your form, if your form is startup form of project you can use hide method otherwise you can use close method.
If your form is startup form and you use close method then you project is closed.
All 9 Replies
debasisdas 580 Posting Genius Featured Poster
bLuEmEzzy 0 Junior Poster in Training
Jx_Man 987 Nearly a Senior Poster Featured Poster
debasisdas commented: agreed +8
Vega_Knight commented: see.. +4
prvnkmr194 0 Posting Whiz in Training
Saikalyankumar -2 Junior Poster in Training
codeorder commented: c# code in vb.net forum :'( +0
Saikalyankumar -2 Junior Poster in Training
debasisdas commented: not experienced enough to ask for that. -2
bLuEmEzzy 0 Junior Poster in Training
Saikalyankumar -2 Junior Poster in Training
samehere -3 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.