if ActiveControl is edit1 then
showmessage('就是');

解决方案 »

  1.   

    if edit1.Focused=True then 
    begin
    //do
    end;
      

  2.   

    if (ActiveControl = edit1)  then
        showmessage('sdfds');
      

  3.   

    if edit1.Focused=True then
    begin
      //do you want 
    end;
      

  4.   

    if (ActiveControl = edit1)  then
        showmessage('sdfds');
      

  5.   

    if (ActiveControl = edit1)  then
        showmessage('sdfds');
      

  6.   

    前两位说的都对。讨论一下,如果用Actionlist把Edit的动作转给了其他控件,
    那么用
    if ActiveControl is edit1 then
    showmessage('就是');是不是不对了,我只是这么想,请指教。
      

  7.   

    if (ActiveControl = edit1)  then
        showmessage('sdfds');
      

  8.   

    edit1.foucusd
    又学一招,activecontrol.
      

  9.   

    好像sender as Tedit也可以吧!
      

  10.   

    if edit1.Focused
    then // dosomething
    else
      edit1.setFocus;