[ACCEPTED]-VB.NET Stacking Select Case Statements together like in Switch C#/Java-case-statement

Accepted answer
Score: 34

Your understanding is correct. VB will not 5 "fall through".

Specify a single 4 Case and separate each expression with a comma:

Select Case Test
    Case 11, 12, 13
        MsgBox.Show("Could be 11 or 12 or 13?")
End Select

Alternatively, you 3 could use a range with the To keyword to accomplish 2 the same thing:

Select Case Test
    Case 11 To 13
        MsgBox.Show("Could be 11 or 12 or 13?")
End Select

For more information, see 1 the documentation.

More Related questions