📄 unit4.~pas
字号:
unit Unit4;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Grids, DBGrids, DB, DBTables, StdCtrls, Buttons, DBCtrls;
type
TForm4 = class(TForm)
Label1: TLabel;
Table1: TTable;
DataSource1: TDataSource;
DBGrid1: TDBGrid;
SpeedButton1: TSpeedButton;
RadioButton1: TRadioButton;
RadioButton2: TRadioButton;
RadioButton3: TRadioButton;
Table1BDEDesigner: TStringField;
Table1BDEDesigner2: TStringField;
Table1BDEDesigner3: TStringField;
Table1BDEDesigner4: TStringField;
Table1BDEDesigner5: TStringField;
Table1BDEDesigner6: TStringField;
RadioButton4: TRadioButton;
RadioButton5: TRadioButton;
RadioButton6: TRadioButton;
Memo1: TMemo;
SpeedButton2: TSpeedButton;
Edit1: TEdit;
Label2: TLabel;
procedure SpeedButton2Click(Sender: TObject);
procedure RadioButton1Click(Sender: TObject);
procedure RadioButton2Click(Sender: TObject);
procedure RadioButton3Click(Sender: TObject);
procedure RadioButton4Click(Sender: TObject);
procedure RadioButton5Click(Sender: TObject);
procedure RadioButton6Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form4: TForm4;
implementation
{$R *.dfm}
procedure TForm4.SpeedButton2Click(Sender: TObject);
begin
table1.refresh;
with table1 do
try
disablecontrols;
filtered:=false;
filter:=memo1.text;
filtered:=true;
finally
enablecontrols;
if table1.recordcount=0 then begin
messagebeep(1);
showmessage('没有符合条件的航班,请确认条件或放弃查询!');
if messageDlg('是否继续查询?,只有结束查询才能作其它操作!',mtinformation,[mbYes,mbNo],0)=mrno then begin
filtered:=false;
table1.close;
table1.open;
end;
end else begin
if messageDlg('是否继续查询?,只有结束查询才能作其它操作!',mtinformation,[mbYes,mbNo],0)=mrno then begin
filtered:=false;
table1.close;
table1.open;
end;
end;
end;
end;
procedure TForm4.RadioButton1Click(Sender: TObject);
begin
memo1.Text:='航班号='+''''+edit1.Text+'''';
end;
procedure TForm4.RadioButton2Click(Sender: TObject);
begin
memo1.Text:=' 发出城市='+''''+edit1.Text+'''';
end;
procedure TForm4.RadioButton3Click(Sender: TObject);
begin
memo1.Text:='到达城市='+''''+edit1.Text+'''';
end;
procedure TForm4.RadioButton4Click(Sender: TObject);
begin
memo1.Text:='起飞时间='+''''+edit1.Text+'''';
end;
procedure TForm4.RadioButton5Click(Sender: TObject);
begin
memo1.Text:='到达时间='+''''+edit1.Text+'''';
end;
procedure TForm4.RadioButton6Click(Sender: TObject);
begin
memo1.Text:='所属公司='+''''+edit1.Text+'''';
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -