JOIN DEVPPL

It looks like you are new here. If you want to get involved, click on Join below!



Code to cancel click event


D

keyboard_arrow_up
0
keyboard_arrow_down


First Post Mark as Spam danieltoomey
Posts: 1 - Registered: 2013-04-22 23:30:38

Using Visual Basics 2010

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.


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



Not sure what to use to cancel the event for both the confirmmsg = 7 and confirmmsg = 2.
Any help would be appreciated.






JOIN DEVPPL

It looks like you are new here. If you want to get involved, click on Join below!




MENU
Advertising