请问,知道了控件名称如何找到这个控件并对它进行操作,比如知道了一edit的名称为BMBM,如何找到这个控件呢,并对这个控件进行操作。

解决方案 »

  1.   

    TEDit(FindComponent('bmbm')).caption:='':
      

  2.   

    (FindComponent('bmbm') as TEDit).caption:='':
      

  3.   

    (FindComponent('bmbm') as TEDit).caption:='':
      

  4.   

    TEdit(FindComponent('bmbm')).Text:='123':
      

  5.   

    (FindComponent('bmbm') as TEDit).caption:='':
      

  6.   

    for i:=0 to screen.components do
    if screen.components[i] is TEdit then
    if screen.components[i].componentname='BMBM' then
      (screen.components[i] as TEdit).text :='sddd';
      

  7.   

    edit1:=窗体名称.FindComponent('bmbm'));
    然后对它进行什么操作都行