unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls; type TForm1 = class(TForm) btn1: TButton; Edit1: TEdit; Button1: TButton; Label1: TLabel; Memo1: TMemo; CheckBox1: TCheckBox; ComboBox1: TComboBox; Label2: TLabel; Panel1: TPanel; Label3: TLabel; Label4: TLabel; Label5: TLabel; procedure btn1Click(Sender: TObject); procedure Button1Click(Sender: TObject); procedure Edit1KeyUp(Sender: TObject; var Key: Word; Shift: TShiftState); procedure CheckBox1Click(Sender: TObject); procedure ComboBox1Change(Sender: TObject); procedure Memo1Click(Sender: TObject); procedure Memo1KeyUp(Sender: TObject; var Key: Word; Shift: TShiftState); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.btn1Click(Sender: TObject); begin showmessage('Hello World!'); end; procedure TForm1.Button1Click(Sender: TObject); begin if(Edit1.Text<>'') then begin showmessage(Edit1.Text); Edit1.Text := ''; end; end; procedure TForm1.Edit1KeyUp(Sender: TObject; var Key: Word; Shift: TShiftState); begin if (Key = VK_RETURN) then begin Memo1.Lines.Add(Edit1.Text); Edit1.Text := ''; end; end; procedure TForm1.CheckBox1Click(Sender: TObject); begin Memo1.ReadOnly := not CheckBox1.Checked; end; procedure TForm1.ComboBox1Change(Sender: TObject); begin case ComboBox1.ItemIndex of 0 : Memo1.Alignment := taLeftJustify; 1 : Memo1.Alignment := taRightJustify; 2 : Memo1.Alignment := taCenter; end; end; procedure TForm1.Memo1Click(Sender: TObject); begin Label3.Caption := 'Označený text: ' + Memo1.SelText; Label4.Caption := 'Začátek označení: ' + IntToStr(Memo1.SelStart); Label5.Caption := 'Počet znaků označení:' + IntToStr(Memo1.SelLength); end; procedure TForm1.Memo1KeyUp(Sender: TObject; var Key: Word; Shift: TShiftState); begin Memo1.OnClick(self); end; end.