如何得到焦点所在的控件的name

解决方案 »

  1.   

    if ActiveControl<>nil then
      Self.Caption:=ActiveControl.Name;
      

  2.   

    Screen.ActiveControl.Name 可得到控件名
    但我要得到这个控件的CAPTION怎么弄?
      

  3.   

    难道我还要去遍历控件找到名字等于Screen.ActiveControl.Name 然后再取CAPTION,
      

  4.   

    if ActiveControl<>nil then
      Self.Caption:=ActiveControl.classname