21-09-2011, 01:03 AM
استخدم الPrefix property
الباقي من نصيبك
==============================
الباقي من نصيبك
كود :
procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);
var
s1: string;
begin
s1 := Edit1.Text;
s1 := StringReplace(s1, 'Cargem', '', [rfReplaceAll]);
s1 := s1 + Key;
s1 := 'Cargem' + s1;
Edit1.Text := s1;
end;كود :
object Form1: TForm1
Left = 0
Top = 0
Caption = 'Form1'
ClientHeight = 206
ClientWidth = 339
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
OldCreateOrder = False
PixelsPerInch = 96
TextHeight = 13
object Edit1: TEdit
Left = 40
Top = 32
Width = 121
Height = 21
TabOrder = 0
Text = 'Cargem'
OnKeyPress = Edit1KeyPress
end
end
