|
-
Sep 14th, 2005, 12:55 AM
#1
Thread Starter
Lively Member
Question on message box
Hi everybody
I would like to ask everybody a question.........the code belows shown as:
Dim dlgRes As DialogResult
dlgRes = MessageBox.Show( _
"Are you sure you want to overwrite the entries", _
"Mp500", _
MessageBoxButtons.YesNo, _
MessageBoxIcon.Question)
If dlgRes = DialogResult.No Then
Application.Exit()
the code above shown that if the user click "No", the whole application is exit.........but i do not want this to happen...........i just want:if the user click "no", it will only exit the message box and does nothing.........may i know how to do this ?...........thank u very much............
-
Sep 14th, 2005, 12:58 AM
#2
Re: Question on message box
remove the application.exit()
-
Sep 14th, 2005, 12:59 AM
#3
Hyperactive Member
Re: Question on message box
Well, I would just include a test then for the Yes Value
VB Code:
Dim dlgRes As DialogResult
dlgRes = MessageBox.Show( _
"Are you sure you want to overwrite the entries", _
"Mp500", _
MessageBoxButtons.YesNo, _
MessageBoxIcon.Question)
If dlgRes = DialogResult.Yes Then
Do what you want and don't include else for No
End If
Or
Exit Sub ¿
VB Code:
Dim dlgRes As DialogResult
dlgRes = MessageBox.Show( _
"Are you sure you want to overwrite the entries", _
"Mp500", _
MessageBoxButtons.YesNo, _
MessageBoxIcon.Question)
If dlgRes = DialogResult.No Then
Exit Sub
End If
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|