19-07-2010, 07:05 PM
و عليكم السلام عليكم و رحمة الله
لقبض الزر المضغوط بالحدث Edit1KeyPress
الزر enter هو VK_RETURN
للإنتقال إلى edit2
و هذا كود آخر مع إضافة نزع الرنين ( الصوت )
و بالتوفيق
لقبض الزر المضغوط بالحدث Edit1KeyPress
الزر enter هو VK_RETURN
كود :
procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
if (Key = Char(VK_RETURN)) then
begin
// أكتب التعليمات
end;
end;للإنتقال إلى edit2
كود :
procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
if (Key = Char(VK_RETURN)) then
Edit2.SetFocus ;
end;و هذا كود آخر مع إضافة نزع الرنين ( الصوت )
كود :
procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
if (Key = #13) then
begin
key := #0; // لنزع الطنين الصوت
edit2.SetFocus ;
end;
end;و بالتوفيق

