I have a program thats wirtes and reads to/from a text file. I also added the ability to delete things from the text file. However, before the delete takes place, I ask the user: "Are you sure you want to delete?" However, even if they click "No", it still deletes! Heres my code:
VB Code:
Dim dlgResult As DialogResult dlgResult = MessageBox.Show("Are you sure you want to delete this?", "Help", MessageBoxButtons.YesNo, MessageBoxIcon.Question) If dlgResult = DialogResult.No Then Else 'All the delete stuff in here End If
I also tried it the other way
VB Code:
Dim dlgResult As DialogResult dlgResult = MessageBox.Show("Are you sure you want to delete this?", "Help", MessageBoxButtons.YesNo, MessageBoxIcon.Question) If dlgResult = DialogResult.Yes Then 'Delete stuff here Else End If
but it still doesent work. Anybody know why not?
Thanks!


Reply With Quote