![]() |
|
Float SpinEdit - نسخة قابلة للطباعة +- delphi4arab منتديات دلفي للعرب (https://delphi4arab.net/forum) +-- قسم : منتديات دلفي للعرب التعليمية (https://delphi4arab.net/forum/forumdisplay.php?fid=3) +--- قسم : سؤال و جواب حول دلفي (https://delphi4arab.net/forum/forumdisplay.php?fid=15) +--- الموضوع : Float SpinEdit (/showthread.php?tid=11233) |
Float SpinEdit - wadi.alyaqut - 10-02-2021 السلام عليكم ورحمة الله بحثت عن مكون لاستقبال الأرقام الكسرية في دلفي 10.3.3 ولم أجد. في لازاروس، يوجد مكون اسمه FloatSpinEdit، ولكن لم أجده في دلفي. فما الحل في استقبال الأرقام الكسرية؟ السلام عليكم وجدت الحل في الكود التالي: كود : procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
if not (Key in [#8,#13, '0'..'9', '-', '.']) then
begin
Key := #0;
end//End first if.
else
if ((Key = '.') or (Key = '-')) and (Pos(Key, Edit1.Text) > 0) then
begin
Key := #0;
end//End second if.
else
if (Key = '-') and (Edit1.SelStart <> 0) then
begin
Key := #0;
end//End third if.
else if key=#13 then Button1.SetFocus;
end; |