0

Hello all, i would like you to answer me a question:

I have a Select case statement:

Select Case textbox1.text

and i want to add more than one case,for example:

Select Case textbox1.text and checkbox1.checked

is it possible in any way to do this with VB.NET???


Thanks in advance,
Alex

4
Contributors
4
Replies
5
Views
9 Years
Discussion Span
Last Post by sierrainfo
0

yes but how can i do this? could you post an example of that.....

Thanks

0

I don't think it is possible. Do something like this:

Select Case textbox1.text
            Case "case1"
                If CheckBox1.Checked Then
                    'code
                Else
                    'code
                End If
            Case "case2"
                If CheckBox1.Checked Then
                    'code
                Else
                    'code
                End If
            Case Else
                MessageBox.Show("none of the above")
        End Select
0

Select Case textbox1.text
Case "case1"
If CheckBox1.Checked Then
'Your code
Else
'Your code
End If
Case "case2"
If CheckBox1.Checked Then
'Your code
Else
'Your code
End If
Case Else
MessageBox.Show("Default")
End Select

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.