Develop and Download Open Source Software

Browse Subversion Repository

Annotation of /trunk/Unit2.pas

Parent Directory Parent Directory | Revision Log 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    

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26