如何獲得處於SetFocus狀態的可視控件。然後達到對該控件修改一些屬性。在線等待,分不夠再加 (30分)

  • 主题发起人 主题发起人 lycheng7622
  • 开始时间 开始时间
L

lycheng7622

Unregistered / Unconfirmed
GUEST, unregistred user!
遍例窗体中所有的控件, 如果某一个控件获得焦点, 然后对此控件进行操作
procedure TForm1.Button2Click(Sender: TObject);
var
i: Integer;
begin
Button1.SetFocus;
for i := 0 to Form1.ControlCount - 1 do
begin
if Button1.Focused then
begin
Button1.Caption := 'GetFocus';
end;
end;
end;
 
TCustomForm.ActiveControl
 
TWinControl(ActiveControl).Top:=20;
所有可视化组件的, 
 
有沒有辦法,當某控件獲得焦點時返回他的類名。
 
TCustomForm.ActiveControl.classname
 
多人接受答案了。
 
后退
顶部