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

Member Avatar for iamthwee

Yes this is possible.

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

Thanks

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

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.