unit Unit1;<br><br>interface<br><br>uses<br> Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,<br> Db, ADODB, StdCtrls;<br><br>type<br> TForm1 = class(TForm)<br> Edit1: TEdit;<br> Edit2: TEdit;<br> procedure Edit1KeyUp(Sender: TObject; var Key: Word;<br> Shift: TShiftState);<br> procedure FormCreate(Sender: TObject);<br> private<br> { Private declarations }<br> public<br> { Public declarations }<br> end;<br><br>var<br> Form1: TForm1;<br><br>implementation<br><br>{$R *.DFM}<br><br>procedure TForm1.Edit1KeyUp(Sender: TObject; var Key: Word;<br> Shift: TShiftState);<br>begin<br> IF (Shift <>[ssAlt])or (not (Key in['0'..'9'])) then begin<br> Key :=ord(#0);<br> exit;<br> end;<br> Edit2.Text := inttoHex(strtoint(Edit1.Text),4);<br><br>end;<br><br>procedure TForm1.FormCreate(Sender: TObject);<br>begin<br> Edit1.Text := '';<br>end;<br><br>end.<br>