求一个数字输入控件,控制只能输入整数或实数

解决方案 »

  1.   

    直接用edit
    限制一下就可以了
      

  2.   


          if not( key in ['0'..'9',#13,#8] )then
            begin
              key := #0;
              showmessage('Only numeric allowed here!');
            end;////整数       if not( key in ['0'..'9',#13,'.',#8] )then
            begin
              key := #0;
              showmessage('Only numeric and . allowed here!');
            end;//整数  实数
      

  3.   

    同意楼上的
    直接用EDIT就可以实现
      

  4.   

    ?
    自己是完全可以实现的
    要找的话 RAIZE控件的RAIZE EDIT的 RzNumericEdit可以满足你的要求
    选择其属性"IntegersOnly"为false表示可以输入整型&浮点型 否则只能整型