Okay folks, on last question and then I think I will have my project finished. I have a click event to clear the entire sheet of the program I'm writing. But I want it to be user confirmed because I don't want anyone to loose information they may not have wanted to. The code I have displays the message with a yes/no/cancel button in it. This is the code I have so far.
[Code]
Private Sub clearSheetButton_Click(sender As System.Object, e As System.EventArgs) Handles clearSheetButton.Click
Dim confirmmsg As Integer
confirmmsg=("Are you sure you want to complete this action?",vbYesNoCancel + vbExcamation, "Confirmation")
If confirmmsg = 6 Then
expenseTypeListBox.Items.Clear()
expenseAmountListBox.Items.Clear()
incomeListBox.Items.Clear()
totalExpensesTextBox.Text = ""
totalIncomeTextBox.Text = ""
surplusDeficiteTextBox.Text = ""
ElseIf confirmmsg = 7 Then
ElseIf confirmmsg = 2 Then
End Sub
[Code]
Not sure what to use to cancel the event for both the confirmmsg = 7 and confirmmsg = 2.
Any help would be appreciated.
[Code]
Private Sub clearSheetButton_Click(sender As System.Object, e As System.EventArgs) Handles clearSheetButton.Click
Dim confirmmsg As Integer
confirmmsg=("Are you sure you want to complete this action?",vbYesNoCancel + vbExcamation, "Confirmation")
If confirmmsg = 6 Then
expenseTypeListBox.Items.Clear()
expenseAmountListBox.Items.Clear()
incomeListBox.Items.Clear()
totalExpensesTextBox.Text = ""
totalIncomeTextBox.Text = ""
surplusDeficiteTextBox.Text = ""
ElseIf confirmmsg = 7 Then
ElseIf confirmmsg = 2 Then
End Sub
[Code]
Not sure what to use to cancel the event for both the confirmmsg = 7 and confirmmsg = 2.
Any help would be appreciated.