English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I'm writing a program in VB and i want another window to pop up and ask for confirmation when i press the delete button. How can i call the
confirmation window?
Thanks

2006-11-09 07:16:57 · 4 answers · asked by fintanabb 1 in Computers & Internet Programming & Design

4 answers

Private Sub Form_KeyPress(KeyAscii As Integer)
If KeyAscii = 8 Then
NameOfTheForm.Show
End If
End Sub

2006-11-09 07:18:04 · answer #1 · answered by piquet 7 · 0 0

You can use an OK/Cancel type of msgbox for that.

The way msgbox works is that, after having been called and selected, it returns an integer value based on the button pressed. So, if you do something like:

if (msgbox("Do you really want to delete this?",1) == 1)
then (// delete function)
else (// cancel operation)

you'll get a confirmation box.

2006-11-09 07:27:53 · answer #2 · answered by Anonymous · 0 0

myResult = msgbox ("Are you sure?", vbYesNoCancel, "Confirm Delete")
if myResult = vbYes then 'process confirmation

2006-11-09 07:19:57 · answer #3 · answered by disposable_hero_too 6 · 1 0

use msgbox="........."
Make to buttons on the form.

2006-11-09 07:19:11 · answer #4 · answered by (Sk8) Julien (Sk8) 2 · 0 0

fedest.com, questions and answers