تصحيح خلل في المقآرنة عند انشآء مستخدم جديد,
في الكود, في الفورم NewUserFrm
كود :
procedure TNewUserForm.SpeedButton1Click(Sender: TObject);//Register
begin
if NameEdt.Text = '' then //Check User Name
begin
NameEdt.Color := $008080FF ;
Exit ;
end;
if (PwdEdt1.Text <> PwdEdt2.Text) OR (PwdEdt1.Text = '' ) then //Check Password
begin
PwdEdt1.Color := $008080FF ;
PwdEdt2.Color := $008080FF ;
Exit ;
end;
if EmailEdt.Text = '' then //Check Email
begin
EmailEdt.Color := $008080FF ;
Exit ;
end;
// Start Registration Process Here
end;
هناك خطأ يحدث مع الألوان,
في حآلة المقآرنة التي تتم بين ال Password1 و ال Password2 ويكون هناك خلل تصبح حينها ال Edit 1 و 2 بالون الأحمر, في حآلة تصحيح الخلل من PassWord2 لا يرجع الون الى الأبيض حتى بعض الضغط على التسجيل,
الحلّ, كتآبة الكود التآلي,
كود :
procedure TNewUserForm.SpeedButton1Click(Sender: TObject);//Register
begin
if NameEdt.Text = '' then //Check User Name
begin
NameEdt.Color := $008080FF ;
Exit ;
end;
if (PwdEdt1.Text <> PwdEdt2.Text) OR (PwdEdt1.Text = '' ) then //Check Password
begin
PwdEdt1.Color := $008080FF ;
PwdEdt2.Color := $008080FF ;
Exit ;
end
else begin // ----------------- هنا كان الخلل,
PwdEdt1.Color := $00ffffff ;
PwdEdt2.Color := $00ffffff ;
end;
if EmailEdt.Text = '' then //Check Email
begin
EmailEdt.Color := $008080FF ;
Exit ;
end;
// Start Registration Process Here
end;
او استغلال ال PwdEdit 2 onChange ووضعه كما هو في الإدين الأول,
كود :
procedure TNewUserForm.PwdEdt2Change(Sender: TObject);
begin
PwdEdt1.Color := ClWhite ;
PwdEdt2.Color := ClWhite ;
end;
وسآمحني لآنني وضعت الحلّ هنا, لكن لا استطيع رفع المشروع الى المنتدى حآليّا, والسبب ستعرفه في سؤآلي في المشآركة السآبقة,
بالتوفيق اخوآني,