一个Button,一个Label,Label初始值为0 ,当每点一次Button Label的值就在上一次值的基础上增加100,也就是点第一次为100,第二次就为200,第三次就为300!.....求助写详细点!不胜感激。

解决方案 »

  1.   


    Label1.Caption := Inc(StrToIntDef(Label1.Caption, 100), 100);
      

  2.   

    Button1.Caption:=IntToStr(StrToInt(Label1.Caption)+100)
      

  3.   

    Label1.Caption := IntToStr(Inc(StrToIntDef(Label1.Caption, 100), 100));
    應該是這樣才對!
      

  4.   

    Label1.Caption := inttostr(strtoint(Label1.Caption)+100);
      

  5.   

    请问楼上大侠们如果在放一个button每点一次就少100 又怎么做呢?
      

  6.   

    label1.Caption := IntToStr(StrToIntDef(Label1.Caption) - 100)