forked from efecanicoz/lad_configurator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Unit5.cpp
46 lines (44 loc) · 1.27 KB
/
Unit5.cpp
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
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit5.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm5 *Form5;
//---------------------------------------------------------------------------
__fastcall TForm5::TForm5(TComponent* Owner)
: TForm(Owner)
{
Password="";
Result=false;
pass1->Text="";
pass2->Text="";
}
//---------------------------------------------------------------------------
void __fastcall TForm5::CancClick(TObject *Sender)
{
Password="";
Result=false;
pass1->Text="";
pass2->Text="";
Close();
}
//---------------------------------------------------------------------------
void __fastcall TForm5::okClick(TObject *Sender)
{
if(pass1->Text!=pass2->Text)
{
MessageBox(this->Handle, AnsiString("Passwords in both fields must be the same.").c_str(),AnsiString("Warning").c_str(), MB_ICONWARNING);
return;
}
if(pass1->Text.Length()<4)
{
MessageBox(this->Handle, AnsiString("Password must contain at least 4 characters.").c_str(),AnsiString("Warning").c_str(), MB_ICONWARNING);
return;
}
Password = pass1->Text;
Result=true;
Close();
}
//---------------------------------------------------------------------------