⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 unit3.pas

📁 全文检索 快速搜寻一般文字档
💻 PAS
字号:
unit Unit3;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ComCtrls;

type
  TForm3 = class(TForm)
    RichEdit1: TRichEdit;
    FindDialog1: TFindDialog;
    procedure FindDialog1Find(Sender: TObject);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form3: TForm3;

implementation

uses Unit1;

{$R *.dfm}

procedure TForm3.FindDialog1Find(Sender: TObject);
var Foundat :LongInt;
    StartPos,ToEnd:Integer;
begin
{
    if RichEdit1.SelLength <> 0
    then StartPos:=RichEdit1.SelStart + RichEdit1.SelLength
    else StartPos:=0;

    ToEnd:=Length(Richedit1.Text)-StartPos;

    FoundAt:=RichEdit1.FindText(FindDialog1.FindText,StartPos,ToEnd,[stMatchCase]);
       showmessage(inttostr(FoundAt));
    if FoundAt <> -1 then
    begin
       RichEdit1.SetFocus;
       RichEdit1.SelStart := FoundAt;
       RichEdit1.SelLength := Length(FindDialog1.FindText);

    end;
//    else showmessage('

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -