|
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, | |
Dialogs, OleServer, Word2000, StdCtrls, ExtCtrls; | |
TForm1 = class(TForm) | |
GroupBox1: TGroupBox; | |
GroupBox2: TGroupBox; | |
Edit1: TEdit; | |
Edit2: TEdit; | |
Label1: TLabel; | |
Label2: TLabel; | |
Label3: TLabel; | |
Label4: TLabel; | |
Label5: TLabel; | |
Edit3: TEdit; | |
Edit4: TEdit; | |
Edit5: TEdit; | |
ComboBox1: TComboBox; | |
ComboBox2: TComboBox; | |
Button1: TButton; | |
Label6: TLabel; | |
Button2: TButton; | |
procedure Button1Click(Sender: TObject); | |
procedure Button2Click(Sender: TObject); | |
{ Private declarations } | |
{ Public declarations } | |
Form1: TForm1; | |
wdth:=StrToInt(Form1.Edit1.Text)/StrToInt(Form1.Edit5.Text); | |
hght:=StrToInt(Form1.Edit2.Text)/StrToInt(Form1.Edit5.Text); | |
case Form1.ComboBox1.ItemIndex of | |
wdth:=wdth*25.4; | |
end; | |
wdth:=wdth*2.54; | |
end; | |
case Form1.ComboBox2.ItemIndex of | |
hght:=hght*25.4; | |
end; | |
hght:=hght*2.54; | |
end; | |
end; | |
Form1.Edit3.Text:=FloatToStr(wdth); | |
Form1.Edit4.Text:=FloatToStr(hght); | |
procedure TForm1.Button1Click(Sender: TObject); | |
procedure TForm1.Button2Click(Sender: TObject); | |