高亮 TRichEdit 当前行
var
gStart, gLength, gCol: Integer; procedure SetRichEdit(aRichEdit: TRichEdit);
var
fRow, fCol: Integer;
fStart, fLength, tStart: Integer;
begin
fRow := aRichEdit.CaretPos.X;
fCol := aRichEdit.CaretPos.Y;
if gCol = fCol then Exit;
if aRichEdit.SelLength > then Exit; tStart := aRichEdit.SelStart;
fStart := tStart - fRow;
fLength := aRichEdit.Lines[fCol].Length; aRichEdit.Lines.BeginUpdate; if fLength > then
begin
aRichEdit.SelStart := fStart;
aRichEdit.SelLength := fLength;
aRichEdit.SelAttributes.Color := clRed;
end; if gLength > then
begin
aRichEdit.SelStart := gStart;
aRichEdit.SelLength := gLength;
// aRichEdit.SelectAll;
aRichEdit.SelAttributes.Color := clBlack;
end; aRichEdit.SelStart := tStart;
aRichEdit.SelLength := ; aRichEdit.Lines.EndUpdate; gStart := fStart;
gLength := fLength;
gCol := fCol;
end; procedure TForm1.RichEdit1Click(Sender: TObject);
begin
SetRichEdit(TRichEdit(Sender));
end; procedure TForm1.RichEdit1KeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
begin
if Key in [..] then SetRichEdit(TRichEdit(Sender));
end;
高亮 TRichEdit 当前行的更多相关文章
- PL/SQL显示行号和高亮当前行
PL/SQL Developer 如何显示行号: PL/SQL Developer 高亮当前行: OK!
- codeblocks设置当前行高亮
默认是不开启当前行高亮的. 如果想打开,选择:Settings>Editor>Editor Settings>Other options> 勾选Highlight line u ...
- Excel 高亮当前行、高亮重复行的探索
本文原创,转载请注明出处:https://www.cnblogs.com/wotent/p/15348891.html TLDR 下载文件 高亮.zip ,将解压后的"高亮.xlam&quo ...
- Vxe-table 高亮当前行
需求 1 :设置初始高亮 子组件: 父组件 需求 2 :高亮行的变化,需要把数据传递到兄弟组件中 解决办法:EventBus 参考链接: http://t.csdn.cn/iwOJc main.js ...
- Excel 当前行高亮
格式-条件格式-条件(公式)- =ROW()=CELL("row") 再选颜色...即可.
- Table表格滑过当前项[当前行][当前列]对应高亮
效果演示图: JS 代码如下: function TableHover($table){ $table.mouseenter(function(event) { va ...
- vim的高亮查找操作
使用了VIM这么久,却一直无法牢记一些基本的操作指令.今天查找一个关键字时,想不起来怎么查找“下一个”,于是google之并解决,顺便把有用的都贴过来罢. 查找指令:/xxx 往下查找?xxx 往上 ...
- MWeb 1.5 发布!增加打字机滚动模式、发布到 Evernote、印象笔记、Wordpress.com、Blogger、编辑器内代码块语法高亮
打字机滚动模式(Typewriter Scrolling) 快捷键:CMD + Option + T,菜单:View - Typewriter Scrolling ,效果如下图: 发布到 Everno ...
- [Linux] vim的高亮查找操作
reference : http://blog.chinaunix.net/uid-20732478-id-763411.html 使用了VIM这么久,却一直无法牢记一些基本的操作指令.今天查找一个 ...
随机推荐
- 实用脚本----Linux下Jdk和Tomcat自动安装shell脚本总结
系统环境为:ubuntu 14.04 一.JDK 自动安装脚本 jdk自动安装bash shell脚本,截止今天(2014/10/15)亲测可用: sudo su #切换到root权限 mkdir / ...
- clob型不能用 distinct,以及转换clob类型方法
举例clob型不能用 distinct public List<WorkingPaper> findAssignedWorkPapers(String projectId, String ...
- python学习之——安装Beautifulsoup、requests、lxml
安装Beautiful soup: 1.下载安装包,解压到python的安装目录: 2.cmd 进入安装包解压后的存放位置: 3.使用命令:python setup.py build , pyt ...
- strstr函数的用法
C语言函数 编辑 包含文件:string.h 函数名: strstr 函数原型: extern char *strstr(char *str1, const char *str2); 语法: ...
- Linux 条件判断
1. 按照文件类型判断 -b 文件 #判断文件是否存在,并且是设备文件 -c 文件 #判断文件是否存在,并且是字符设备文件 -d 目录 #判断目录是否存在,并且是否为目录(是目录返回真) -e 文件 ...
- 用Navicat_SSH 连接数据库服务器
SSH设置(只限于Mysql.oracle.PostgreSQL及 SQL Server 并只支持 SSH2通讯协定) Secure SHell(SSH)是一个通过网络登录其他计算机的程序,在远程服务 ...
- VS2013开发 windows服务 挂到服务器上执行
这是百度经验的链接,本人主要参考的他.http://jingyan.baidu.com/article/cd4c2979e9330d756f6e6070.html 1 创建windows服务项目 2 ...
- JAVA可移植性广泛应用
一.JAVA作为一种编程语言:源代码可移植性 作为一种编程语言,JAVA提供了一种最简单同时也是人们最熟悉的可移植性–源代码移植.这意味着任意一个JAVA程序,不论它运行在何种CPU.操作系统或JAV ...
- js高级应用
特别板块:js跨域请求Tomcat6.tomcat7 跨域设置(包含html5 的CORS) 需要下载两个jar文件,cors-filter-1.7.jar,Java-property-utils-1 ...
- RSpec shared examples with template methods
It’s pretty common to have multiple tests that are nearly the same. In one app, we support bidding o ...