290

uses
windows, messages, sysutils, classes, graphics, controls, forms, dialogs, stdctrls, buttons;

type
tform1 = class (tform)
memo1: tmemo;
button1: tbutton;
button2: tbutton;
opendialog1: topendialog;
bitbtn1: tbitbtn;
button3: tbutton;
fontdialog1: tfontdialog;
procedure button1click(sender: tobject );
procedure button2click(sender: tobject );
procedure button3click(sender: tobject );
private
< private declarations >
public
< public declarations >
end ;

var
form1: tform1;

uses printers; // Эта ссылка обязательна!

procedure tform1.button1click(sender: tobject );
// Выбор файла с текстом и его загрузка в редактор
begin
if opendialog1.execute then
memo1.lines.loadfromfile(opendialog1.filename)
end ;

procedure tform1.button3click(sender: tobject );
// Выбор шрифта и связывание его с memo1
begin
if fontdialog1.execute then
memo1.font := fontdialog1.font
end ;

Оцените статью
SoftLast
Добавить комментарий