-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuFrmCalendario.pas
More file actions
59 lines (48 loc) · 1.29 KB
/
uFrmCalendario.pas
File metadata and controls
59 lines (48 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
unit uFrmCalendario;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.Grids, Vcl.Samples.Calendar;
type
TFrmCalendario = class(TForm)
Calendar1: TCalendar;
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormDestroy(Sender: TObject);
procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
procedure FormKeyPress(Sender: TObject; var Key: Char);
private
{ Private declarations }
public
{ Public declarations }
end;
var
FrmCalendario: TFrmCalendario;
implementation
{$R *.dfm}
procedure TFrmCalendario.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Action := caFree;
end;
procedure TFrmCalendario.FormDestroy(Sender: TObject);
begin
FrmCalendario := nil;
end;
procedure TFrmCalendario.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
//se for pressionado ESC
if (key = vk_escape ) then
begin
//fecha o Form
close;
end
end;
procedure TFrmCalendario.FormKeyPress(Sender: TObject; var Key: Char);
begin
if (key = #13) then
begin
Key := #0;
SelectNext(activeControl,true,true);
end;
end;
end.