📄 search.pas
字号:
unit Search;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TSearchDialog = class(TForm)
Label1: TLabel;
ComboBox1: TComboBox;
Label2: TLabel;
Edit1: TEdit;
Button1: TButton;
Button2: TButton;
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
private
{ Private declarations }
public
{ Public declarations }
class function GetSearchCriteria(var S: string): boolean;
end;
var
SearchDialog: TSearchDialog;
implementation
{$R *.DFM}
class function TSearchDialog.GetSearchCriteria(var S: string): boolean;
begin
Result := False;
with TSearchDialog.Create(nil) do try
ComboBox1.ItemIndex := 0;
if ShowModal = mrOk then begin
Result := True;
S := ComboBox1.Text + ' ' + Edit1.Text;
end;
finally
Release;
end;
end;
procedure TSearchDialog.FormCloseQuery(Sender: TObject;
var CanClose: Boolean);
begin
CanClose := (ModalResult <> mrOk) or
((ComboBox1.Text <> '') and (Edit1.Text <> ''));
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -