Browse Subversion Repository
Annotation of /trunk/Unit2.pas
Parent Directory
| Revision Log
Revision 2 -
( hide annotations)
( download)
( as text)
Sun Feb 22 14:38:06 2015 UTC
(9 years, 1 month ago)
by yamat0jp
File MIME type: text/x-pascal
File size: 1035 byte(s)
| 1 |
yamat0jp |
2 |
unit Unit2; |
| 2 |
|
|
|
| 3 |
|
|
interface |
| 4 |
|
|
|
| 5 |
|
|
uses |
| 6 |
|
|
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, |
| 7 |
|
|
StdCtrls, ExtCtrls; |
| 8 |
|
|
|
| 9 |
|
|
type |
| 10 |
|
|
TOKRightDlg = class(TForm) |
| 11 |
|
|
OKBtn: TButton; |
| 12 |
|
|
CancelBtn: TButton; |
| 13 |
|
|
Bevel1: TBevel; |
| 14 |
|
|
Edit1: TEdit; |
| 15 |
|
|
Edit2: TEdit; |
| 16 |
|
|
Label1: TLabel; |
| 17 |
|
|
Label2: TLabel; |
| 18 |
|
|
procedure FormCreate(Sender: TObject); |
| 19 |
|
|
procedure Edit1Change(Sender: TObject); |
| 20 |
|
|
private |
| 21 |
|
|
{ Private éž } |
| 22 |
|
|
public |
| 23 |
|
|
{ Public éž } |
| 24 |
|
|
end; |
| 25 |
|
|
|
| 26 |
|
|
var |
| 27 |
|
|
OKRightDlg: TOKRightDlg; |
| 28 |
|
|
|
| 29 |
|
|
implementation |
| 30 |
|
|
|
| 31 |
|
|
{$R *.dfm} |
| 32 |
|
|
|
| 33 |
|
|
procedure TOKRightDlg.FormCreate(Sender: TObject); |
| 34 |
|
|
begin |
| 35 |
|
|
SetWindowLong(Edit1.Handle, GWL_STYLE |
| 36 |
|
|
,GetWindowLong(Edit1.Handle,GWL_STYLE) or ES_NUMBER); |
| 37 |
|
|
SetWindowLong(Edit2.Handle, GWL_STYLE |
| 38 |
|
|
,GetWindowLong(Edit2.Handle,GWL_STYLE) or ES_NUMBER); |
| 39 |
|
|
end; |
| 40 |
|
|
|
| 41 |
|
|
procedure TOKRightDlg.Edit1Change(Sender: TObject); |
| 42 |
|
|
var |
| 43 |
|
|
s: string; |
| 44 |
|
|
begin |
| 45 |
|
|
s:=TEdit(Sender).Text; |
| 46 |
|
|
if s = '' then |
| 47 |
|
|
TEdit(Sender).Text:='0' else |
| 48 |
|
|
TEdit(Sender).Text:=IntToStr(StrToInt(s)); |
| 49 |
|
|
end; |
| 50 |
|
|
|
| 51 |
|
|
end. |
| 52 |
|
|
|
| |