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');
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 单元测试从入门到精通
· 上周热点回顾(3.3-3.9)
· winform 绘制太阳,地球,月球 运作规律