我的Windows窗体应用程序有一个注销按钮,单击时会提示MsgBox弹出询问用户是否确定他想记录是否退出。我是新来的Visual Basic,所以我不知道我应该放在Elseif语句中,以便当用户单击MsgBox上的“否”时,MsgBox将消失,表单将再次显示。这是我的代码:当用户单击MsgBox上的“否”时程序不会返回到表单
Private Sub cmd_logout_Click(sender As Object, e As EventArgs) Handles cmd_logout.Click
MsgBox("Are you sure you want to log-out?", MsgBoxStyle.YesNo)
If MsgBoxResult.Yes Then
Me.Close()
ElseIf MsgBoxResult.No Then
(I'm not sure what I should put here I'm having a hard time figuring it out)
End If
End Sub
在此先感谢。