改为 =True 就可以了,错误原因是字符串和布尔型不兼容

解决方案 »

  1.   

    checked 属性是boolean类型,你拿它跟字符串做什么比较
      

  2.   

    不要画蛇添脚,直接写成这样就行了:
    if rzchckbx1.Checked then
      

  3.   

    如果判断没有选中的状态,这样写:
    if not rzchckbx1.Checked then
      

  4.   

    if rzchckbx1.Checked then
      

  5.   

    if rzchckbx1.Checked then

    if rzchckbx1.Checked=true  then
    那种更好?
      

  6.   

    > if rzchckbx1.Checked then
    > 和
    > if rzchckbx1.Checked=true  then
    > 那种更好?后者比前者,多比对了一次。我觉得较不好。
    打字较多,也较不好读。
    感觉后者略逊于前者。
      

  7.   

    布尔型直接if rzchckbx1.Checked then
      

  8.   

    上面大侠们都说了,也不重复了,但先不管你比对方法咋样,楼主也得把单词写对啊,真--true,而不是ture
      

  9.   


    我以前也是犯过这个错!
    正解 if rzchckbx1.Checked then
      

  10.   

     - - 
    你都已经知道是true了,为啥还弄成字符串类型呢,明显类型不匹配
      

  11.   

    改为 if rzchckbx1.Checked then
      

  12.   

    176行错误改为 if rzchckbx1.Checked=False then