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. KinectV1+Ubuntu 14.04安装教程

    前言      个人理解错误的地方还请不吝赐教,转载请标明出处,内容如有改动更新,请看原博:http://www.cnblogs.com/hitcm/      如有任何问题,feel free to ...

  2. 转:亿级Web系统的高容错性实践(好博文)

    亿级Web系统的高容错性实践 亿级Web系统的高容错性实践 背景介绍 大概三年前,我在腾讯负责的活动运营系统,因为业务流量规模的数倍增长,系统出现了各种各样的异常,当时,作为开发的我,7*24小时地没 ...

  3. (转)Jquery最实用的实例及源码(http://www.cnblogs.com/kingfly/archive/2012/12/05/2802539.html)

    1:窗口拖动 http://jqueryui.com/resizable/#max-min 2:导航条前后顺序拖动 http://jqueryui.com/sortable/ 3:类似百度首页板块顺序 ...

  4. 关于在gridview中有dorpdownlist的情况下使用自带编辑模板的方法

    今天记录一下在gridview中,如果有dropdownlist的情况下使用gridview自带编辑模式的方法. 好吧,今天的这个问题有点绕,详细解释一下目的. 因为gridview中的某些列的数据是 ...

  5. Security.website-that-focus-on-mobile-app-security

    Mobile App Security 1. DATA THEOREM LAB https://datatheorem.github.io/ Data Theorem's technical blog ...

  6. 1.1使用内置的Camara应用程序捕捉图像

    一: Camara应用程序包含的意图过滤器 <intent-filter> <action android:name="android.media.action.IMAGE ...

  7. [转载]centos7 快速安装 mariadb(mysql)

    http://blog.csdn.net/default7/article/details/41973887 从最新版本的linux系统开始,默认的是 Mariadb而不是mysql! yum ins ...

  8. ie8 iframe去掉边框的属性

    <iframe src="" id="Iframe" height="200" frameborder="0" s ...

  9. HttpWebRequest类

    HttpWebRequest类与HttpRequest类的区别. HttpRequest类的对象用于服务器端,获取客户端传来的请求的信息,包括HTTP报文传送过来的所有信息.而HttpWebReque ...

  10. ZOJ3774_Power of Fibonacci

    求fibonacci数列前N个数的K次方和. 通项公式:F[n]=((1+sqrt(5))/sqrt(5)-(1-sqrt(5))/sqrt(5))/sqrt(5). 有点乱,不过由于可以保证最后的结 ...