我已经知道了!好象是这样的吧!if sender = edit1 then 
  showmessage('CC');

解决方案 »

  1.   

    if ActiveControl = Edit1 then
      ....
    else if ActiveControl = ComboBox1 then
      ....
      

  2.   

    我是利用同一个OnEnter,但不知道是不是哪个代码?是吗?不是吗?请回答!谢谢!
      

  3.   

    procedure TForm1.Edit1Enter(Sender: TObject);
    begin
      if (Sender is TEdit) then
        ShowMessage('你进入了' + TEdit(Sender).Name)
      else if (Sender is TComboBox) then
        ShowMessage('你进入了' + TComboBox(Sender).Name);
    end;
      

  4.   

    procedure TForm1.Edit1Enter(Sender: TObject);
    begin
      if (Sender=Edit1) then
        ShowMessage('这是'+EDIT1.NAME)
      else if (Sender=ComboBox1) then
        ShowMessage('这是'+ComboBox1.Name);
    end;
      

  5.   

    if (ActiveControL is Tedit) then Tedit(ActiveControl).text:='这是EDIT';
    if (ActiveControl is Tcombobox) then Tcombobox(ActiveControl).text:='这是combobox';