?? unit3.pas
字號:
unit Unit3;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, DBCtrls, Grids, DBGrids, DB, DBTables,
Buttons;
type
TForm3 = class(TForm)
Label1: TLabel;
Table1: TTable;
DataSource1: TDataSource;
DBGrid1: TDBGrid;
DBNavigator1: TDBNavigator;
Bevel1: TBevel;
StaticText1: TStaticText;
RadioButton1: TRadioButton;
RadioButton2: TRadioButton;
RadioButton3: TRadioButton;
RadioButton4: TRadioButton;
RadioButton5: TRadioButton;
RadioButton6: TRadioButton;
Bevel2: TBevel;
SpeedButton1: TSpeedButton;
Memo1: TMemo;
Edit1: TEdit;
Label2: TLabel;
procedure RadioButton1Click(Sender: TObject);
procedure RadioButton2Click(Sender: TObject);
procedure RadioButton3Click(Sender: TObject);
procedure RadioButton4Click(Sender: TObject);
procedure RadioButton5Click(Sender: TObject);
procedure RadioButton6Click(Sender: TObject);
procedure SpeedButton1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form3: TForm3;
implementation
{$R *.dfm}
procedure TForm3.RadioButton1Click(Sender: TObject);
begin
memo1.Text:='學(xué)號=';
end;
procedure TForm3.RadioButton2Click(Sender: TObject);
begin
memo1.Text:='學(xué)生姓名=';
end;
procedure TForm3.RadioButton3Click(Sender: TObject);
begin
memo1.Text:='所在院系=';
end;
procedure TForm3.RadioButton4Click(Sender: TObject);
begin
memo1.Text:='所學(xué)專業(yè)=';
end;
procedure TForm3.RadioButton5Click(Sender: TObject);
begin
memo1.Text:='宿舍電話=';
end;
procedure TForm3.RadioButton6Click(Sender: TObject);
begin
memo1.Text:='籍貫=';
end;
procedure TForm3.SpeedButton1Click(Sender: TObject);
begin
table1.refresh;
with table1 do
try
disablecontrols;
filtered:=false;
memo1.Text:=memo1.Text+''''+edit1.Text+'''';
filter:=memo1.text;
filtered:=true;
finally
enablecontrols;
if table1.recordcount=0 then begin
messagebeep(1);
showmessage('沒有符合條件的學(xué)生,請確認條件或放棄查詢!');
if messageDlg('是否繼續(xù)查詢?,只有結(jié)束查詢才能作其它操作!',mtinformation,[mbYes,mbNo],0)=mrno then begin
filtered:=false;
table1.close;
table1.open;
end;
end else begin
if messageDlg('是否繼續(xù)查詢?,只有結(jié)束查詢才能作其它操作!',mtinformation,[mbYes,mbNo],0)=mrno then begin
filtered:=false;
table1.close;
table1.open;
end;
end;
end;
end;
end.
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -