高亮 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这么久,却一直无法牢记一些基本的操作指令.今天查找一个 ...
随机推荐
- ItextDemo<二>
Nested tables TableTemplate.java /** * Example written by Bruno Lowagie in answer to the following q ...
- SQLServer idenity 字段跳值
修改数据库实例的启动参数 然后修改SQLServer启动参数,打开SQLServer configuration manager,然后选择服务实例,点击右键属性,查看实例的属性界面,然后启动参数选项输 ...
- android opengl es代码功能
/* * Copyright (C) 2009 The Android Open Source Project * * Licensed under the Apache License, Versi ...
- android 使用LinearGradient进行字体渐变的效果
有这么一种效果,一串字符有一束白光从字体上面闪光的效果.如下图显示: 就像上面的显示效果一样一束白光闪过,这种效果主要还是使用了LinearGradient类来进行的 LinearGradient也称 ...
- 使用kindeditor文本编辑器
aspx中代码: <%@ Page Language="C#" ValidateRequest="false" AutoEventWireup=" ...
- servlet总结
什么是Servlet Tomcat容器等级 手工编写第一个Servlet 使用MyEclipse编写Servlet Servlet生命周期 Servlet常用对象,且与Jsp九大内置对象的关系 Ser ...
- iscsi: 多路径
作者:吴香伟 发表于 2014/10/8 版权声明:可以任意转载,转载时务必以超链接形式标明文章原始出处和作者信息以及版权声明 上图(a)给出了计算机的总线结构,SCSI磁盘挂在SCSI卡上,SCSI ...
- new 一个button 然后dispose,最后这个button是null吗???
结果当然不是,button虽然释放了资源,但是它扔指向原来的那个地址,故不等于null 可以用button.isdispose==true判断
- ext.ajax.request请求时带有遮罩效果
ajax请求时有时需要操作大量的数据,反应有时会很慢,这时我们想要来一个遮罩效果,具体步骤如下 1.定义一个遮罩 var myMask = new Ext.LoadMask(Ext.getBody() ...
- python中几个常见的“黑盒子”之 列表list
python常见的数据类型有:字符串,布尔类型,整数,浮点数,数字,日期,列表,元祖,字典.相信前面6个大家都非常的熟悉,但是对于python的列表,元祖,字典我有时候一直在想其内部的实现是怎么样子的 ...