• Register now to get access to thousands of Tutorials, Leaked content, Hot NSFW and much more. Join us as we build and grow the community.

Advertise Here

Advertise Here

Advertise Here

TextBox Validation in Delphi

Keliaho0321

Crypto Community Manager
K Rep
0
0
0
Rep
0
K Vouches
0
0
0
Vouches
0
Posts
39
Likes
71
Bits
2 MONTHS
2 2 MONTHS OF SERVICE
LEVEL 1 200 XP
Delphi validation program

Follow the instructions / procedures below:
1. Open your Delphi IDE
2. Create a Form with 2 TLabels, 2 TEdit and 1 TButton, Just like this:
delphivalidate1_0.png


3. Copy and paste the sourcecodes below:

unit Unit1;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;
type
TForm1 = class(TForm)
Edit1: TEdit;
Label1: TLabel;
Edit2: TEdit;
Label2: TLabel;
Button1: TButton;
procedure Button1Click(Sender: TObject);
procedure Edit1KeyPress(Sender: TObject; var Key: Char);
procedure Edit2KeyPress(Sender: TObject; var Key: Char);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
Application.Terminate;
end;
procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
if Key in ['0'..'9'] then Key := #0;
end;
procedure TForm1.Edit2KeyPress(Sender: TObject; var Key: Char);
begin
if Key in ['a'..'z'] + ['A'..'Z'] then Key := #0;
end;
end.

4. Take note and understand the functionality of the source codes:
delphivalidate2.png_0.png


5. Then Run your Program and input something for Names and Age. It will validate your inputs.


Download
You must upgrade your account or reply in the thread to view the hidden content.
 

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.

452,501

351,349

351,363

Top