简体   繁体   English

代码“删除我的帐户”按钮

[英]Code “delete my account” button

Im using vb 2013. I tried to code my delete button after adding SQL delete in my Database. 我正在使用vb2013。在数据库中添加SQL删除后,我尝试对删除按钮进行编码。 I wrote code in the class (I called it userFunc) calling the SQL DeleteItYourself with the variable DeleteIt. 我在用变量DeleteIt调用SQL DeleteItYourself的类(我称为userFunc)中编写了代码。 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. 我希望它调用函数DeleteIt,但是在函数Delete之前,我希望它向用户发出一些弹出警报,以确定他是否确定。 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) (我是一名高中生,这是我的项目,不幸的是,他们实际上并未教我们Java知识……他们告诉我们复制粘贴并尝试理解)

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. MsgBox向用户显示一个消息框,等待响应,然后返回按下的按钮的值。 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. 窗口标题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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