最好不要用派生

解决方案 »

  1.   

    SetWindowLong(Edit1.Handle, GWL_STYLE,GetWindowLong(Edit1.Handle, GWL_STYLE) or  ES_NUMBER);
      

  2.   

    蹈火者,SetWindowLong这句加在哪里哦?
    create?
      

  3.   

    在组件的keypress中写:
    if not (key in ['0'..'9',#8,#46]) then
      key:=#0;
      

  4.   

    if not (key in ['0'..'9']) then
    key:=chr(0);
      

  5.   

    http://expert.csdn.net/Expert/topic/1765/1765854.xml?temp=6.588161E-03
    结贴吧
      

  6.   

    很简单啊。
    处理该控件的ONKeypress即可。
    if not (key in ['0'..'9',#8,#46]) then
      key:=#0;
      

  7.   

    在组件的keypress中写:
    if not (key in ['0'..'9',#8,#46]) then
      key:=#0;
      

  8.   

    if not (key in ['0'..'9']) then
    key:=chr(0);