?? mc_fybzsd.~pas
字號:
unit MC_FYBZSD;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, Db, Mask, DBCtrls, DBTables, Grids, DBGrids, Buttons;
type
TFYBZSD = class(TForm)
GroupBox1: TGroupBox;
Table1: TTable;
Table1BDEDesigner: TStringField;
Table1BDEDesigner2: TFloatField;
Table1BDEDesigner3: TFloatField;
Table1BDEDesigner4: TFloatField;
Label1: TLabel;
DBEdit1: TDBEdit;
DataSource1: TDataSource;
Label2: TLabel;
DBEdit2: TDBEdit;
Label3: TLabel;
DBEdit3: TDBEdit;
Label4: TLabel;
DBEdit4: TDBEdit;
GroupBox2: TGroupBox;
DBGrid1: TDBGrid;
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
BitBtn3: TBitBtn;
BitBtn4: TBitBtn;
procedure BitBtn3Click(Sender: TObject);
procedure BitBtn1Click(Sender: TObject);
procedure BitBtn2Click(Sender: TObject);
procedure BitBtn4Click(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
private
{ Private declarations }
public
{ Public declarations }
end;
var
FYBZSD: TFYBZSD;
implementation
{$R *.DFM}
procedure TFYBZSD.BitBtn3Click(Sender: TObject);
begin
if Table1.RecordCount<>0 then Table1.Delete;
end;
procedure TFYBZSD.BitBtn1Click(Sender: TObject);
begin
if BitBtn1.Caption='添加[&I]' then
begin
Table1.Insert;
GroupBox1.Enabled:=True;
DBEdit1.Setfocus;
BitBtn1.Caption:='保存[&S]';
BitBtn2.Caption:='取消[&U]';
end
else
begin
if (Length(Table1.fieldbyName('費用類型').AsString)=0) or
(Length(Table1.fieldbyName('水費').AsString)=0) or
(Length(Table1.fieldbyName('電費').AsString)=0) or
(Length(Table1.fieldbyName('煤氣費').AsString)=0) then
begin
ShowMessage('請將數據添全');
end
else
begin
GroupBox1.enabled:=False;
BitBtn1.Caption:='添加[&I]';
Bitbtn2.Caption:='修改[&E]';
Table1.Post;
end;
end;
end;
procedure TFYBZSD.BitBtn2Click(Sender: TObject);
begin
if BitBtn2.Caption='修改[&E]' then
begin
Table1.Edit;
GroupBox1.Enabled:=True;
DBEdit1.Setfocus;
BitBtn1.Caption:='保存[&S]';
BitBtn2.Caption:='取消[&U]';
end
else
begin
GroupBox1.enabled:=False;
BitBtn1.Caption:='添加[&I]';
Bitbtn2.Caption:='修改[&E]';
Table1.Cancel;
end;
end;
procedure TFYBZSD.BitBtn4Click(Sender: TObject);
begin
Close;
end;
procedure TFYBZSD.FormClose(Sender: TObject; var Action: TCloseAction);
begin
FYBZSD.Release;
FYBZSD:=Nil;
end;
end.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -