简体   繁体   中英

Code “delete my account” button

Im using vb 2013. I tried to code my delete button after adding SQL delete in my Database. I wrote code in the class (I called it userFunc) calling the SQL DeleteItYourself with the variable DeleteIt. I created button with the toolbox and double clicked it, now I'm lost. I have session in the Login button to make sure it presents the user nickname. I redirected it to the homepage when the "I want to delete my account" located. Iactually don't know what to do with the button. I want it to call the function DeleteIt, but before the function Delete I want it to ask the user with some pop up alert if he's sure. Any ideas how to code my button? (I'm a high school student and it's my project, they don't ACTUALLY teach us Java, unfortunately... They tell us to copy paste and try to understand)

Use this as a starting point:

If MsgBox("Are you sure you want to delete your account? This cannot be undone.", _
    (MsgBoxStyle.Critical + MsgBoxStyle.OkCancel), _
    "Confirm Account Deletion") = MsgBoxResult.Ok Then

    UserFunc(DeleteIt)
End If

MsgBox displays a message box to the user, waits for a response, and returns the value of the button pressed. In the code above, the three arguments are:

  1. The message to display

  2. The style of the message box. Note how these are numeric values and can be added.

  3. The title of the window.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM