⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 khdhdysz.pas

📁 这是用Delphi编写的中小企业管理系统
💻 PAS
字号:
unit khdhdysz;
       
interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Buttons,khdhbb;

type
  Tf_khdhdysz = class(TForm)
    GroupBox1: TGroupBox;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Label5: TLabel;
    Label6: TLabel;
    Label17: TLabel;
    Label18: TLabel;
    Label20: TLabel;
    Label21: TLabel;
    Label19: TLabel;
    Label22: TLabel;
    Label23: TLabel;
    Label24: TLabel;
    kcmc: TEdit;
    spdm: TEdit;
    spmc: TEdit;
    bzq: TEdit;
    sl: TEdit;
    cess: TEdit;
    hzds: TEdit;
    zk: TEdit;
    dhph: TEdit;
    bzsj: TEdit;
    tax: TEdit;
    jbdw: TEdit;
    wzrje: 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 dhphKeyPress(Sender: TObject; var Key: Char);
    procedure dhphExit(Sender: TObject);
    procedure hzdsExit(Sender: TObject);
    procedure hzdsKeyPress(Sender: TObject; var Key: Char);
    procedure SpeedButton1Click(Sender: TObject);
    procedure SpeedButton2Click(Sender: TObject);
    procedure SpeedButton3Click(Sender: TObject);
    procedure SpeedButton4Click(Sender: TObject);
    procedure BitBtn1Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  f_khdhdysz: Tf_khdhdysz;

implementation

{$R *.dfm}

procedure Tf_khdhdysz.dhphKeyPress(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_khdhdysz.dhphExit(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_khdhdysz.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 := '7';
      end;
      if StrToFloat(TEdit(Sender).Text)=0 then
        TEdit(Sender).Text := '7';
    end
    else
      TEdit(Sender).Text := '7';
end;

procedure Tf_khdhdysz.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_khdhdysz.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_khdhdysz.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_khdhdysz.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_khdhdysz.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;

procedure Tf_khdhdysz.BitBtn1Click(Sender: TObject);
var
  i: Integer;
begin
  Azdkd[0] := StrToFloat(dhph.Text);
  Azdkd[1] := StrToFloat(kcmc.Text);
  Azdkd[2] := StrToFloat(spdm.Text);
  Azdkd[3] := StrToFloat(spmc.Text);
  Azdkd[4] := StrToFloat(jbdw.Text);
  Azdkd[5] := StrToFloat(sl.Text);
  Azdkd[6] := StrToFloat(zk.Text);
  Azdkd[7] := StrToFloat(bzsj.Text);
  Azdkd[8] := StrToFloat(cess.Text);
  Azdkd[9] := StrToFloat(tax.Text);
  Azdkd[10] := StrToFloat(wzrje.Text);
  Azdkd[11] := StrToFloat(je.Text);
  Azdkd[12] := StrToFloat(bzq.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_khdhdysz.FormCreate(Sender: TObject);
begin
  dhph.Text := FloatToStr(Azdkd[0]);
  kcmc.Text := FloatToStr(Azdkd[1]);
  spdm.Text := FloatToStr(Azdkd[2]);
  spmc.Text := FloatToStr(Azdkd[3]);
  jbdw.Text := FloatToStr(Azdkd[4]);
  sl.Text := FloatToStr(Azdkd[5]);
  bzsj.Text := FloatToStr(Azdkd[6]);
  zk.Text := FloatToStr(Azdkd[7]);
  cess.Text := FloatToStr(Azdkd[8]);
  tax.Text := FloatToStr(Azdkd[9]);
  wzrje.Text := FloatToStr(Azdkd[10]);
  je.Text := FloatToStr(Azdkd[11]);
  bzq.Text := FloatToStr(Azdkd[12]);
  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;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -