📄 rptfm.pas
字号:
unit rptFM;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TreportFM = class(TForm)
Button1: TButton;
Memo1: TMemo;
Label1: TLabel;
Label2: TLabel;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
reportFM: TreportFM;
implementation
{$R *.dfm}
procedure TreportFM.Button1Click(Sender: TObject);
var
LineNum:longint;
CharsBeforeLine:longint;
begin
LineNum := SendMessage(Memo1.Handle,EM_LINEFROMCHAR,
Memo1.SelStart,0);
CharsBeforeLine:=SendMessage(Memo1.Handle,EM_LINEINDEX,
LineNum,0);
Label1.Caption:='Line: '+IntToStr(LineNum + 1);
Label2.Caption:='Position: '+IntToStr((Memo1.SelStart -
CharsBeforeLine)+1);
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -