请问为什么下面的代码通不过?如何改啊?大家帮看看,在线等... if Panel1.Hide=true then  Panel1.Show;
   if Panel1.show=true then  Panel1.hide;

解决方案 »

  1.   

    因为Panel1.Hide和Panel2.Show不是函数,更没有Boolean的返回值,用If判断是错的改为
    Panel1.Visible := Not(Panel1.Visible);
      

  2.   

    还有一点,如果是需要判断某变量是否为true的话
    直接写if a then
    不需要写if a=true then
      

  3.   

    Hide和Show是过程,没有返回值
      

  4.   

    那怎么办啊?有没办法?就是点击一下隐藏,再点击一下显示?
    --------
    什么意思?Panel1.Visible := Not(Panel1.Visible);不能实现吗?
    每点一次将Visible属性切换一次,不就是点一下隐藏,再点一下显示?