I have a listbox in my program and a command button. When the user selects an item form the listbox and clicks the command button, a message box is shown which asks the user to confirm selection and has yes and no options to enable this.
If the user clicks yes it will accept the selection, i can do this.
I want the program to be able to offer the message box for confirmation two times after it has first been shown and after the no button is selected each time i want it to go back to the listbox to allow selection. On the third time i want it to automatically accept the choice and not offer confirmation as before.
Dim b As Integer Dim inputno As Integer inputno = 3 Dim dlgRes As DialogResult dlgRes = MessageBox.Show(" Do you wish to select this item", "Confirm choice", MessageBoxButtons.YesNo) If dlgRes = DialogResult.Yes Then listboxselect.SelectedIndex = selecteditem End If