?? databaseconfirmpropertyfrm.pas
字號:
unit DatabaseConfirmPropertyFrm;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, SJCustomProperty, cxLookAndFeelPainters, PropStorageEh,
StdCtrls, cxButtons, ExtCtrls, cxControls, cxContainer, cxEdit,
cxTextEdit, cxMaskEdit, cxButtonEdit;
type
TfrmPropertyDatabaseConfirm = class(TSJCustomPropertyForm)
Label1: TLabel;
edtDataPath: TcxButtonEdit;
Opendlg: TOpenDialog;
procedure edtDataPathPropertiesButtonClick(Sender: TObject;
AButtonIndex: Integer);
procedure btnOKClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
frmPropertyDatabaseConfirm: TfrmPropertyDatabaseConfirm;
implementation
uses SJInvPrintGlobal, MainFrm, Registry;
{$R *.dfm}
procedure TfrmPropertyDatabaseConfirm.edtDataPathPropertiesButtonClick(
Sender: TObject; AButtonIndex: Integer);
// 查找系統(tǒng)數(shù)據(jù)源路徑
begin
inherited;
if edtDataPath.Text <> '' then
Opendlg.InitialDir := edtDataPath.Text
else
Opendlg.InitialDir := ExtractFilePath(Application.ExeName) + 'Data\';
if Opendlg.Execute then
edtDataPath.Text := ExtractFilePath(Opendlg.FileName);
end;
procedure TfrmPropertyDatabaseConfirm.btnOKClick(Sender: TObject);
// 設(shè)置系統(tǒng)數(shù)據(jù)源路徑
begin
inherited;
// 檢查數(shù)據(jù)庫文件是否有效
if Trim(edtDataPath.Text) = '' then
begin
ShowMessage('你沒有設(shè)置系統(tǒng)數(shù)據(jù)庫路徑。');
edtDataPath.SetFocus;
Exit;
end;
// 寫數(shù)據(jù)庫文件路徑到系統(tǒng)注冊表項(xiàng)
with TRegistry.Create do
try
RootKey := HKEY_LOCAL_MACHINE;
if OpenKey(GREGsysPath, True) then
WriteString('Data Source', edtDataPath.Text + gSysDatafile);
GSysDataPath := edtDataPath.Text;
finally
Free;
end;
ModalResult := mrOk;
end;
end.
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -