16,748
社区成员
发帖
与我相关
我的任务
分享
function GetCxGridFocused(aControl: TWinControl): TcxCustomGrid;
begin
Result:= nil;
if aControl is TcxCustomGrid then
Result := TcxCustomGrid(aControl)
else
while aControl.Parent<>nil do
begin
aControl:= aControl.Parent;
if aControl is TcxCustomGrid then
begin
Result:= TcxCustomGrid(aControl);
Break;
end;
end;
end;
procedure TForm1.SpeedButton1Click(Sender: TObject);
begin
Caption := GetCxGridFocused(ActiveControl).Name;
end;