小编Bra*_*don的帖子

不区分大小写

If TextBox2.Text = "a" AndAlso TextBox21.Text = "a" Then
        'MessageBox.Show("A")
        totCorrect = totCorrect + corAns
    ElseIf TextBox2.Text = "b" AndAlso TextBox21.Text = "b" Then
        'MessageBox.Show("B")
        totCorrect = totCorrect + corAns
    ElseIf TextBox2.Text = "c" AndAlso TextBox21.Text = "c" Then
        'MessageBox.Show("C")
        totCorrect = totCorrect + corAns
    ElseIf TextBox2.Text = "d" AndAlso TextBox21.Text = "d" Then
        'MessageBox.Show("D")
        totCorrect = totCorrect + corAns
    Else
        totWrong = totWrong + wrgAns
        Label13.Visible = True
    End If
Run Code Online (Sandbox Code Playgroud)

我试图使用户输入不敏感的字母a,b,c,d.试图使用UCase,但它不起作用(不确定我是否使用它错了).我在Visual Studio 2012中使用VB.任何参考都会很棒.

vb.net case-insensitive visual-studio

5
推荐指数
1
解决办法
1万
查看次数

标签 统计

case-insensitive ×1

vb.net ×1

visual-studio ×1