TTextEditor 项目常见问题解决方案
00]下载+安装
01]加载文本TextEditor1.Text
02]更改正文字体及大小
03]更改语法语言
04]更改视觉Theme
下载
链接:https://pan.baidu.com/s/1F7Z7J_XtcPjN-u7MDk13og 密码:14gq
安装

将C:\Users\PC\Downloads\TTextEditor-main (1)\TTextEditor-main\Source加入Libary




TextEditor1.Text在设计的时候不能设置修改,只能在运行时动态加载
procedure TForm3.FormCreate(Sender: TObject); begin TextEditor1.Lines.LoadFromFile('Unit3.pas'); TextEditor1.GoToLine(1); //显示所有 文本 end;




procedure TForm1.ComboBox1Change(Sender: TObject); begin TextEditor1.Zoom(strToint(ComboBox1.Items[ComboBox1.ItemIndex])); end;


uses TextEditor.CompletionProposal.Snippets;
procedure TForm1.FormCreate(Sender: TObject); var LItem: TTextEditorCompletionProposalSnippetItem; begin //====================输入begin回车 触发 自动 在后面添加 end =================================== { "begin..end" with enter } LItem := TextEditor1.CompletionProposal.Snippets.Items.Add; with LItem do begin Description := 'begin..end'; Keyword := 'begin'; ExecuteWith := seEnter; end; with LItem.Position do begin Active := True; Column := 2; Row := 2; end; with LItem.Snippet do begin Add('begin'); Add(''); Add('end'); end; //=================输入if 空格 触发,自动 在后面添加 True then================================== { "if True then" with space } LItem := TextEditor1.CompletionProposal.Snippets.Items.Add; with LItem do begin Description := 'if True then'; Keyword := 'if'; ExecuteWith := seSpace; end; with LItem.Selection do begin Active := True; FromColumn := 4; ToColumn := 8; FromRow := 1; ToRow := 1; end; LItem.Snippet.Add('if True then'); //================================================== end;
//=================输入pr 空格 触发,自动 在后面添加 procedure================================== { "procedure with space } LItem := TextEditor1.CompletionProposal.Snippets.Items.Add; with LItem do begin Description := 'procedure '; Keyword := 'pr'; ExecuteWith := seSpace; end; with LItem.Position do begin Active := True; Column := 11; Row := 1; end; LItem.Snippet.Add('procedure'); //==================================================
//====================输入with 回车 触发 自动 在后面添加 do end =================================== { "with .. do end" with enter } LItem := TextEditor1.CompletionProposal.Snippets.Items.Add; with LItem do begin Description := 'with..end'; Keyword := 'with'; ExecuteWith := seEnter; end; with LItem.Position do begin Active := True; Column := 6; //光标 在 第六列 Row := 1; // 第一行 end; with LItem.Snippet do begin Add('with do begin'); Add(''); Add('end'); end;
TextEditor1.ExportToHTML('c:\aaa.html');

浙公网安备 33010602011771号