请问,我如何才能知道控件是否获得了输入焦点?(BTN,EDT)(50分)

G

geyufly

Unregistered / Unconfirmed
GUEST, unregistred user!
请问,我如何才能知道控件是否获得了输入焦点?(BTN,EDT)
 
if Button1.Focused = true then

Edit1.Focused
 
笨方法:
edit1.hint:='asdfasf';

在edit1的onenter方法中写入
edit1.ShowHint:=true;

当控件获得焦点是就会显示'asdfasf'
 
要看你怎么写的程序了。一般来说可以用TForm.ActiveControl判定获得焦点的控件。当然也
有例外的时候。
 
if btn.focused then
begin

end
 
接受答案了.
 
顶部