-
Notifications
You must be signed in to change notification settings - Fork 2
Home
ps147258 edited this page Dec 13, 2020
·
2 revisions
Vcl.Memo.LineNumbers
用途:
快速並簡易的在一般控制項上繪製 Memo 多行文字的行編號。
Features:
Simple and fast to use to draw the line number of Memo multi-line text on general control items.
Example:
procedure TForm1.FormCreate(Sender: TObject);
begin
// 當設定參數 AOwner,將 Memo1 作為這個 TLineNumbers 的擁有者時,
// 在 Memo1 執行 Destroy 時 TLineNumbers 的 Destroy 也會被引動。
// 所以設定 Owner 後,也不適合在其他有覆蓋目標 WindowProc 的控制項上隨意的釋放。
//
// The first parameter AOwner, Memo1 is used as the owner of this TLineNumbers.
// when Memo1 in Destroy the destruction of TLineNumbers will be triggered.
// So, when setting the Owner, it is not suitable for destroying other controls
// that override the target WindowProc in an unplanned.
TLineNumbers.Create(Memo1, Memo1, True);
// 當設定了 Owner,可以不必用一個變數來放置這個物件。
// When the Owner is set, no need for a variable to keep this object.
end;