unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, NxScrollControl, NxCustomGridControl, NxCustomGrid, NxGrid,
  NxColumns, NxColumnClasses, StdCtrls;

type
  TForm1 = class(TForm)
    NextGrid1: TNextGrid;
    NxTextColumn1: TNxTextColumn;
    Button1: TButton;
    edtText: TEdit;
    GroupBox1: TGroupBox;
    radFromSelected: TRadioButton;
    radEntireScope: TRadioButton;
    GroupBox2: TGroupBox;
    chbCaseSensitive: TCheckBox;
    Label1: TLabel;
    chbWholeWords: TCheckBox;
    chbContinue: TCheckBox;
    procedure FormCreate(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure radEntireScopeClick(Sender: TObject);
    procedure radFromSelectedClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
begin
  NextGrid1.AddCells(['Bill', 'Jimy', 'Larry', 'Mike', 'Phill', 'Mona', 'Lisa', 'Susan', 'Marry', 'Johny',
    'Michael', 'Dona', 'Larry', 'Ed', 'Jeff', 'Donovan', 'Lisa', 'Gerry']);
end;

procedure TForm1.Button1Click(Sender: TObject);
var
  SearchOptions: TSearchOptions;
begin
  SearchOptions := [];
  if not chbCaseSensitive.Checked then Include(SearchOptions, soCaseInsensitive);

  if radFromSelected.Checked then Include(SearchOptions, soFromSelected);

  if chbContinue.Checked then Include(SearchOptions, soContinueFromTop);

  if chbWholeWords.Checked then Include(SearchOptions, soExactMatch);

  NextGrid1.FindText(0, edtText.Text, SearchOptions);
end;

procedure TForm1.radEntireScopeClick(Sender: TObject);
begin
  chbContinue.Enabled := False;
end;

procedure TForm1.radFromSelectedClick(Sender: TObject);
begin
  chbContinue.Enabled := True;
end;

end.
