?? backdropdialog.pas
字號:
unit BackdropDialog;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ExtCtrls, FileCtrl;
type
TFrm_BackdropDialog = class(TForm)
FileListBox1: TFileListBox;
Image1: TImage;
Label1: TLabel;
Btn_ok: TButton;
Button2: TButton;
procedure FileListBox1Click(Sender: TObject);
procedure Btn_okClick(Sender: TObject);
procedure FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
procedure FormActivate(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Frm_BackdropDialog: TFrm_BackdropDialog;
implementation
uses main, sys_dm;
{$R *.DFM}
var
pfname: string ;
mydir: string ;
procedure TFrm_BackdropDialog.FileListBox1Click(Sender: TObject);
begin
pfname := FileListBox1.FileName ;
image1.Picture.LoadFromFile(pfname);
end;
procedure TFrm_BackdropDialog.Btn_okClick(Sender: TObject);
begin
pfname := trim(pfname);
with Frm_sys_dm.Qr_tmp3 do // 將圖片文件名存入public.db中
begin
close;
sql.clear;
sql.Add('update pdata');
sql.add('set PictureName = '''+ pfname+'''');
execsql;
close;
end;
if pfname <> '' then
Frm_Main.Img_Background.Picture.LoadFromFile(pfname);
close;
end;
procedure TFrm_BackdropDialog.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if key = vk_escape then
close ;
end;
procedure TFrm_BackdropDialog.FormActivate(Sender: TObject);
begin
mydir := FileListBox1.Directory ;
FileListBox1.Directory := mydir+'\picture' ;
end;
procedure TFrm_BackdropDialog.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
FileListBox1.Directory := mydir ;
end;
end.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -