unit Unit1;
//20160715
interface
uses
Winapi.Windows,
Winapi.Messages, System.SysUtils, System.Variants, System.Classes,
Vcl.Graphics,
Vcl.Controls,
Vcl.Forms,
Vcl.Dialogs, SpellCheck,
Vcl.StdCtrls;
type
TForm1 =
class(TForm)
Label1: TLabel;
Edit1: TEdit;
Button1: TButton;
ListBox1: TListBox;
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
SpellCheck1: TSpellCheck;
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
ListBox1.Clear;
if SpellCheck1.IsMisspelled(Edit1.Text)
then
SpellCheck1.GetSuggestions(Edit1.Text, ListBox1.Items)
else
ShowMessage(Edit1.Text+'
is not misspelled');
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
SpellCheck1 := TSpellCheck.Create(Self);
SpellCheck1.AffFileName := ExtractFilePath(Application.ExeName)+'
de_DE.aff';
SpellCheck1.DictFileName := ExtractFilePath(Application.ExeName)+'
de_DE.dic';
SpellCheck1.Active := True;
end;
end.