对于我的表单上的退出按钮,这是足够的代码吗?
这是我的代码:
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim response As MsgBoxResult
response = MsgBox("Do you want to close form?", MsgBoxStyle.Question + MsgBoxStyle.YesNo, "Confirm")
If response = MsgBoxResult.Yes Then
Me.Dispose()
ElseIf response = MsgBoxResult.No Then 'Button to exit the program completely
Exit Sub
End If
End Sub