InputBox

topsykretts

Well-known member
Joined
Dec 22, 2011
Messages
47
Programming Experience
Beginner
I have an inputbox with yes/no buttons.

Dim b As String
b = InputBox("Hello", "Hello", "")
If b = "" Then
Dim Cancel As MsgBoxResult = MessageBox.Show("Cancel?", "Cancel?", MessageBoxButtons.YesNo)
If Cancel = MsgBoxResult.Yes Then
Me.Close()
ElseIf MsgBoxResult.No Then
b = InputBox("Hello", "Hello", "")
End If
End If

How to repeat showing input box everytime when user chosing a cancelebutton,not only one time?
 
Put it in a Do_Loop.
Every time Cancel comes out as no, loop back to b = InputBox("Hello", "Hello", "")
You might need to declare a few flag variables for that.
 
Back
Top