I want small help with code. I want something to happen when text in TextBox1 is A or B or C without writing same code 3 times. I don't know how to write it. I tried with it:
If TextBox1.Text = "A" or "B" or "C" Then
If TextBox1.Text = "A" Or TextBox1.Text = "B" Or TextBox1.Text = "C" Then
There's no magic way to do it, but there's others ways like storing the values A,B,C in an array and loop for a match or using RegEx.
I'd use RegEx for a short code, something like this:
IF ( RegEx.Match(TextBox1.Text, "^[ABC]$").Success ) Then
To use RegEx you need to import System.Text.RegularExpressions.