-1

TextBox插入多个命令时出现此错误。

从字符串“I”到类型“Boolean”的转换无效

我收到此错误的代码是:

If TextBox1.Text = "I" Then TextBox20.Text = "I" And TextBox32.Text = "I" And TextBox44.Text = "I"
If TextBox2.Text = "I" Then TextBox19.Text = "I" And TextBox31.Text = "I" & TextBox43.Text = "I"
If TextBox3.Text = "I" Then TextBox17.Text = "I" And TextBox29.Text = "I" & TextBox42.Text = "I"
If TextBox4.Text = "I" Then TextBox18.Text = "I" And TextBox28.Text = "I" & TextBox41.Text = "I"
If TextBox8.Text = "I" Then TextBox16.Text = "I" And TextBox27.Text = "I" & TextBox40.Text = "I"
If TextBox7.Text = "I" Then TextBox15.Text = "I" And TextBox26.Text = "I" & TextBox39.Text = "I"
If TextBox6.Text = "I" Then TextBox14.Text = "I" And TextBox25.Text = "I" & TextBox38.Text = "I"
If TextBox5.Text = "I" Then TextBox13.Text = "I" And TextBox24.Text = "I" & TextBox37.Text = "I"
If TextBox30.Text = "I" Then TextBox11.Text = "I" And TextBox23.Text = "I"
If TextBox33.Text = "I" Then TextBox10.Text = "I" And TextBox22.Text = "I" & TextBox35.Text = "I"
If TextBox48.Text = "I" Then TextBox47.Text = "I" And TextBox21.Text = "I" & TextBox34.Text = "I"
If TextBox52.Text = "I" Then TextBox51.Text = "I" And TextBox46.Text = "I" & TextBox45.Text = "I"
If TextBox9.Text = "I" Then TextBox12.Text = "I" And TextBox50.Text = "I" & TextBox49.Text = "I"

有什么建议么?他们都开始If TextBox不只是TextBox

4

1 回答 1

2

我只修复了一条线作为其他线的示例。

If TextBox1.Text = "I" Then 
      TextBox20.Text = "I" 
      TextBox32.Text = "I" 
      TextBox44.Text = "I" 
End If

AND 运算符用于在两个表达式之间执行逻辑运算,导致布尔 TRUE/FALSE 结果不重复执行命令。

于 2013-10-12T21:47:04.207 回答