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 当前行的更多相关文章

  1. PL/SQL显示行号和高亮当前行

    PL/SQL Developer 如何显示行号: PL/SQL Developer 高亮当前行: OK!

  2. codeblocks设置当前行高亮

    默认是不开启当前行高亮的. 如果想打开,选择:Settings>Editor>Editor Settings>Other options> 勾选Highlight line u ...

  3. Excel 高亮当前行、高亮重复行的探索

    本文原创,转载请注明出处:https://www.cnblogs.com/wotent/p/15348891.html TLDR 下载文件 高亮.zip ,将解压后的"高亮.xlam&quo ...

  4. Vxe-table 高亮当前行

    需求 1 :设置初始高亮 子组件: 父组件 需求 2 :高亮行的变化,需要把数据传递到兄弟组件中 解决办法:EventBus 参考链接: http://t.csdn.cn/iwOJc main.js ...

  5. Excel 当前行高亮

    格式-条件格式-条件(公式)- =ROW()=CELL("row") 再选颜色...即可.

  6. Table表格滑过当前项[当前行][当前列]对应高亮

    效果演示图: JS 代码如下: function TableHover($table){       $table.mouseenter(function(event) {            va ...

  7. vim的高亮查找操作

    使用了VIM这么久,却一直无法牢记一些基本的操作指令.今天查找一个关键字时,想不起来怎么查找“下一个”,于是google之并解决,顺便把有用的都贴过来罢. 查找指令:/xxx 往下查找?xxx 往上  ...

  8. MWeb 1.5 发布!增加打字机滚动模式、发布到 Evernote、印象笔记、Wordpress.com、Blogger、编辑器内代码块语法高亮

    打字机滚动模式(Typewriter Scrolling) 快捷键:CMD + Option + T,菜单:View - Typewriter Scrolling ,效果如下图: 发布到 Everno ...

  9. [Linux] vim的高亮查找操作

    reference :  http://blog.chinaunix.net/uid-20732478-id-763411.html 使用了VIM这么久,却一直无法牢记一些基本的操作指令.今天查找一个 ...

随机推荐

  1. EXCEL拼接SQL

    =CONCATENATE("insert into 表名 (字段名1,字段名2)values (3,  '"&C3&"');") 用CONCAT ...

  2. html5调取手机摄像头或相册

    html5调用手机摄像头或者相册 由于input的type=file 格式的文件的界面并不是我们所希望的界面,所以在此我隐藏input,自定义样式,这个样式就在<a>中自己定义,这里我就不 ...

  3. 2-3. Using Type Deduction

    Type Deduction 发生在编译时期 可以对一般类型,自定义类型进行类型自推导 下面有两个例子: 1. Using auto with a class #include <iostrea ...

  4. ebtables hook

    1 概述 netfliter框架不仅仅在ipv4中有应用,bridge,ipv4,ipv6,decnet 这四种协议中都有应用,其中ipv4中又分开了arp和ip的两种 其实netfliter是个大的 ...

  5. MVC 之 WebAPI 系列二

    今天,我想在此记录下 WebApi 跨域调用 1. 什么叫跨域: 跨域问题简单理解就是JavaScript同源策略的限制,其根本原因是因为浏览器对于这种请求,所给予的权限是较低的,通常只允许调用本域中 ...

  6. MyISAM和InnoDB索引区别

    MyISAM引擎使用B+Tree作为索引结构,叶节点的data域存放的是数据记录的地址.下图是MyISAM索引的原理图: 图8 这里设表一共有三列,假设我们以Col1为主键,则图8是一个MyISAM表 ...

  7. 一点一滴学shell-Shell expr的用法 (转)

    原文链接:http://desheng666.blog.163.com/blog/static/4908408220121643953425/ expr命令一般用于整数值,但也可用于字符串.一般格式为 ...

  8. 下载Spring框架开发包

    1.打开官网: http://spring.io/,打开project >> spring framework 2.在右侧找到要用的版本,如4.3.4,打开reference,搜索&quo ...

  9. 【转载】PHP 开发者该知道的 5 个 Composer 小技巧

    Composer是新一代的PHP依赖管理工具.其介绍和基本用法可以看这篇<Composer PHP依赖管理的新时代>.本文介绍使用Composer的五个小技巧,希望能给你的PHP开发带来方 ...

  10. 在线编辑器的使用-KindEditor

    第一种:KindEditor编辑器 步骤一:加载相应的核心的文件 下载地址:http://kindeditor.net/demo.php <link rel="stylesheet&q ...