我正在尝试在按钮中使用Application.ActivateHint来显示其提示。
根本不起作用,目标按钮中没有任何提示。
表单之外没有任何容器。
procedure TForm1.btn2Click(Sender: TObject);
var
PosScr1: TPoint;
Btn_Test: TButton;
begin
Btn_Test := nil;
Btn_Test := TButton(Self.FindComponent('Btn_Test'));
if not Assigned(Btn_Test) then
begin
// Generated by GExperts "Component to Code"
// To clone the original target button
// and leave the method self-suficient for
// StackOverflow
Btn_Test := TButton.Create(Self);
with Btn_Test do
begin
Name := 'Btn_Test';
Parent := Self;
Left := 176;
Top := 56;
Width := 75;
Height := 25;
Hint := 'Testing';
Caption := 'Btn_Test';
ParentShowHint := False;
ShowHint := True;
TabOrder := 0;
end;
//***********************
end;
PosScr1 := ClientToScreen(Btn_Test.BoundsRect.TopLeft);
Application.ActivateHint(PosScr1);
end;