私はLazarus v0.9.30(32ビットコンパイラ)を使用しています。 TStringGridのTColumnTitleオブジェクトに関連付けられたオブジェクトに格納されているヒントテキストを表示するために使用する次のコードを用意しました。TStringGridセルに関連付けられたヒントテキストのフォントサイズを変更するには
procedure TTmMainForm.TmApplicationPropertiesShowHint
(
var HintStr: string;
var CanShow: boolean;
var HintInfo: THintInfo
);
var
aGrid : TStringGrid;
aColumnTitle : TTmColumnTitle;
aRow : integer;
aColumn : integer;
begin
aRow := 0;
aColumn := 0;
HintInfo.HintMaxWidth := 200;
HintInfo.HideTimeout := 10000;
HintInfo.HintColor := $00D7FBFA;
//Get a pointer to the current grid.
aGrid := TStringGrid(HintInfo.HintControl);
//Find out what cell the mouse is pointing at.
aGrid.MouseToCell(HintInfo.CursorPos.X, HintInfo.CursorPos.Y, aColumn, aRow);
if ((aRow = 0) and (aColumn < aGrid.ColCount)) then
begin
//Get the object associated with the column title.
aColumnTitle := TTmColumnTitle(aGrid.Objects[aColumn, aRow]);
//Define where the hint window will be displayed.
HintInfo.CursorRect := aGrid.CellRect(aColumn, aRow);
//Display the hint.
HintStr := Trim(aColumnTitle.stHint);
end; {if}
end;
私はHintInfoオブジェクトにアクセスでき、ヒントテキストのフォントサイズを変更するために使用します。 HintInfoオブジェクトはHintInfo.HintControl.Fontへのアクセスを提供しますが、これを使用すると、基になるTStringGridのすべてのセルテキストのフォントが変更されます。 HintInfoオブジェクトはHintinfo.HintWindowClass.Fontへのアクセスも提供しますが、Font.Sizeにアクセスすることはできません。ヒントのフォントサイズを変更する方法はありますか?