Results 1 to 2 of 2

Thread: Yes/No Deleting Options (RESOLVED)

Threaded View

  1. #1

    Thread Starter
    Addicted Member The Phoenix's Avatar
    Join Date
    Aug 2003
    Location
    With my wife
    Posts
    142

    Yes/No Deleting Options (RESOLVED)

    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:
    1. Dim dlgResult As DialogResult
    2.             dlgResult = MessageBox.Show("Are you sure you want to delete this?", "Help", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
    3.             If dlgResult = DialogResult.No Then
    4.             Else
    5.           'All the delete stuff in here
    6.             End If

    I also tried it the other way

    VB Code:
    1. Dim dlgResult As DialogResult
    2.             dlgResult = MessageBox.Show("Are you sure you want to delete this?", "Help", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
    3.             If dlgResult = DialogResult.Yes Then
    4. 'Delete stuff here
    5.             Else
    6.             End If

    but it still doesent work. Anybody know why not?

    Thanks!
    Last edited by The Phoenix; Aug 24th, 2003 at 01:01 AM.
    Take my love
    Take my land
    Take me where I cannot stand
    I don't care, I'm still free
    You can't take the sky from me...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width