【delphi开源代码栏目提醒】:网学会员,鉴于大家对delphi开源代码十分关注,论文会员在此为大家搜集整理了“khyfkdysz.pas”一文,供大家参考学习!
unit khyfkdysz;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons,khyfkbb;
type
Tf_khyfkdysz = class(TForm)
GroupBox1: TGroupBox;
Label1: TLabel;
Label3: TLabel;
Label5: TLabel;
Label17: TLabel;
Label18: TLabel;
Label19: TLabel;
Label23: TLabel;
Label24: TLabel;
khmc: TEdit;
fkxt: TEdit;
fkje: TEdit;
hzds: TEdit;
fkph: TEdit;
sj: TEdit;
fkr: TEdit;
je: TEdit;
GroupBox2: TGroupBox;
Label7: TLabel;
Label8: TLabel;
Label9: TLabel;
Label10: TLabel;
Label15: TLabel;
Label16: TLabel;
btgd: TEdit;
btjj: TEdit;
Gridjj: TEdit;
dqfs: TComboBox;
admjj: TEdit;
timejj: TEdit;
GroupBox3: TGroupBox;
Label11: TLabel;
Label12: TLabel;
Label13: TLabel;
SpeedButton1: TSpeedButton;
SpeedButton2: TSpeedButton;
SpeedButton3: TSpeedButton;
Label14: TLabel;
SpeedButton4: TSpeedButton;
BitBtn1: TBitBtn;
FontSet: TFontDialog;
procedure fkphKeyPress(Sender: TObject; var Key: Char);
procedure fkphExit(Sender: TObject);
procedure hzdsExit(Sender: TObject);
procedure hzdsKeyPress(Sender: TObject; var Key: Char);
procedure BitBtn1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure SpeedButton1Click(Sender: TObject);
procedure SpeedButton2Click(Sender: TObject);
procedure SpeedButton3Click(Sender: TObject);
procedure SpeedButton4Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
f_khyfkdysz: Tf_khyfkdysz;
implementation
{$R *.dfm}
procedure Tf_khyfkdysz.fkphKeyPress(Sender: TObject; var Key: Char);
var
i: Boolean;
begin
i := (Key<#8)or(Key>#8)and(Key<#46)or(Key>#46)and(Key<#48)or(Key>#57);
if i then
Key := #0;
end;
procedure Tf_khyfkdysz.fkphExit(Sender: TObject);
begin
if Sender is TEdit then
if Trim(TEdit(Sender).Text)<>'' then
begin
Try
StrToFloat(TEdit(Sender).Text);
Except
Application.MessageBox('请输入合法数据.','提示',64);
TEdit(Sender).Text := '1.0';
end;
if StrToFloat(TEdit(Sender).Text)=0 then
TEdit(Sender).Text := '1.0';
end
else
TEdit(Sender).Text := '1.0';
end;
procedure Tf_khyfkdysz.hzdsExit(Sender: TObject);
begin
if Sender is TEdit then
if Trim(TEdit(Sender).Text)<>'' then
begin
Try
StrToInt(TEdit(Sender).Text);
except
Application.MessageBox('请输入合法数据.','提示',64);
TEdit(Sender).Text := '8';
end;
if StrToFloat(TEdit(Sender).Text)=0 then
TEdit(Sender).Text := '8';
end
else
TEdit(Sender).Text := '8';
end;
procedure Tf_khyfkdysz.hzdsKeyPress(Sender: TObject; var Key: Char);
var
i: Boolean;
begin
i := (Key<#8)or(Key>#8)and(Key<#48)or(Key>#57);
if i then
Key := #0;
end;
procedure Tf_khyfkdysz.BitBtn1Click(Sender: TObject);
var
i: Integer;
begin
Azdkd[0] := StrToFloat(fkph.Text);
Azdkd[1] := StrToFloat(khmc.Text);
Azdkd[2] := StrToFloat(fkxt.Text);
Azdkd[3] := StrToFloat(fkje.Text);
Azdkd[4] := StrToFloat(sj.Text);
Azdkd[5] := StrToFloat(fkr.Text);
Sumzdkd := 0;
if (StrToInt(hzds.Text)<=0)or(StrToInt(hzds.Text)>zds)then
begin
Application.MessageBox('每行字段数不能大于表格字段数.','提示',64);
Cols := zds;
end
else
Cols := StrToInt(hzds.Text);
For i := 0 to 5 do
Sumzdkd := Sumzdkd+Azdkd[i];
Rowzdkd := Cols*(Sumzdkd/6);
with Content do
begin
TitleHeight:= StrToFloat(btgd.Text);
BtHeight:= StrToFloat(btjj.Text);
Bgjj:= StrToFloat(Gridjj.Text);
Czyjj:= StrToFloat(admjj.Text);
sjjj:= StrToFloat(timejj.Text);
Bgdqfs:= dqfs.ItemIndex;
end;
Close;
end;
procedure Tf_khyfkdysz.FormCreate(Sender: TObject);
begin
fkph.Text := FloatToStr(Azdkd[0]);
khmc.Text := FloatToStr(Azdkd[1]);
fkxt.Text := FloatToStr(Azdkd[2]);
fkje.Text := FloatToStr(Azdkd[3]);
sj.Text := FloatToStr(Azdkd[4]);
fkr.Text := FloatToStr(Azdkd[5]);
hzds.Text := IntToStr(Cols);
with Content do
begin
btgd.Text:= FloatToStr(TitleHeight);
btjj.Text:= FloatToStr(BtHeight);
Gridjj.Text:= FloatToStr(Bgjj);
admjj.Text:= FloatToStr(Czyjj);
timejj.Text:= FloatToStr(sjjj);
dqfs.ItemIndex:= Bgdqfs;
end;
end;
procedure Tf_khyfkdysz.SpeedButton1Click(Sender: TObject);
begin
if FontSet.Execute = True then
with TitleFont do
begin
RFontName := FontSet.Font.Name;
RFontSize := FontSet.Font.Size;
RFontStyle := FontSet.Font.Style;
RFontColor := FontSet.Font.Color;
end;
end;
procedure Tf_khyfkdysz.SpeedButton2Click(Sender: TObject);
begin
if FontSet.Execute = True then
with BtFont do
begin
RFontName := FontSet.Font.Name;
RFontSize := FontSet.Font.Size;
RFontStyle := FontSet.Font.Style;
RFontColor := FontSet.Font.Color;
end;
end;
procedure Tf_khyfkdysz.SpeedButton3Click(Sender: TObject);
begin
if FontSet.Execute = True then
with BgTitleFont do
begin
RFontName := FontSet.Font.Name;
RFontSize := FontSet.Font.Size;
RFontStyle := FontSet.Font.Style;
RFontColor := FontSet.Font.Color;
end;
end;
procedure Tf_khyfkdysz.SpeedButton4Click(Sender: TObject);
begin
if FontSet.Execute = True then
with BgFont do
begin
RFontName := FontSet.Font.Name;
RFontSize := FontSet.Font.Size;
RFontStyle := FontSet.Font.Style;
RFontColor := FontSet.Font.Color;
end;
end;
end.
上一篇:
khyfkbb.pas
下一篇:
病理学实验课多样化教学方法探讨