-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDBPathUnit.cpp
More file actions
48 lines (44 loc) · 1.53 KB
/
DBPathUnit.cpp
File metadata and controls
48 lines (44 loc) · 1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "DBPathUnit.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
//TDBPathForm *DBPathForm;
//---------------------------------------------------------------------------
__fastcall TDBPathForm::TDBPathForm(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TDBPathForm::BrowseBtnClick(TObject *Sender)
{
if (OpenDialog1->Execute())
{
DBPathEdit->Text = OpenDialog1->FileName;
}
}
//---------------------------------------------------------------------------
void __fastcall TDBPathForm::OkBtnClick(TObject *Sender)
{
if (FileExists(DBPathEdit->Text) == true)
{
ModalResult = mrOk;
}
else
{
ShowMessage("Ôàéë ïî âûáðàííîìó ïóòè íå ñóùåñòâóåò");
}
}
//---------------------------------------------------------------------------
void __fastcall TDBPathForm::FormCreate(TObject *Sender)
{
//âûñòàâëÿåì ïîëîæåíèå îêíà ïî öåíòðó
if (Screen->MonitorCount > 1)
{
this->Left = (Screen->Monitors[0]->Width - this->Width) / 2;
this->Top = (Screen->Monitors[0]->Height - this->Height) / 2;
};
}
//---------------------------------------------------------------------------