Unit1.pas
资源名称:xiaobai.rar [点击查看]
上传用户:autowell
上传日期:2022-06-21
资源大小:16754k
文件大小:1k
源码类别:
Delphi控件源码
开发平台:
Delphi
- unit Unit1;
- interface
- uses
- Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
- Dialogs, ExtCtrls, DBCtrls, Grids, DBGrids, DB, DBTables, StdCtrls,
- ADODB, Mask;
- type
- TForm1 = class(TForm)
- Label1: TLabel;
- DataSource1: TDataSource;
- ADOConnection1: TADOConnection;
- DBGrid1: TDBGrid;
- DBNavigator1: TDBNavigator;
- ADOQuery1: TADOQuery;
- DBEdit1: TDBEdit;
- DBEdit2: TDBEdit;
- DBEdit3: TDBEdit;
- Button1: TButton;
- Button2: TButton;
- Edit1: TEdit;
- procedure Button1Click(Sender: TObject);
- procedure Button2Click(Sender: TObject);
- procedure Edit1Change(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
- var
- Form1: TForm1;
- implementation
- {$R *.dfm}
- procedure TForm1.Button1Click(Sender: TObject);
- begin
- ADOQuery1.active:=true;
- end;
- procedure TForm1.Button2Click(Sender: TObject);
- begin
- ADOQuery1.active:=false;
- end;
- procedure TForm1.Edit1Change(Sender: TObject);
- begin
- if edit1.Text<>'xiaobai' then
- DBNavigator1.VisibleButtons:=[nbFirst,nbPrior,nbNext,nblast]
- else DBNavigator1.VisibleButtons:=[nbFirst,nbPrior,nbNext,nbLast,nbInsert,nbDelete,nbEdit,nbPost,nbCancel,nbRefresh]
- end;
- end.