عدم السماح بادخال اكثر من رقمين بعد الفاصلة
#14
كود :
procedure TAdvEdit.AutoSeparators; var s, si, neg: string; d: Double; Diffl, OldSelStart, OldPrec: Integer; begin s := self.Text; Diffl := Length(s); OldSelStart := 0; if HandleAllocated then OldSelStart := SelStart; if (s = '') then Exit; if (Pos('-', s) = 1) then begin Delete(s, 1, 1); neg := '-'; end else neg := ''; if (Pos(DecimalSeparator, s) > 0) then s := Copy(s, Pos(DecimalSeparator, s), 255) else s := ''; d := Trunc(Abs(self.FloatValue)); if FAutoThousandSeparator then si := Format('%n', [d]) else si := Format('%f', [d]); si := Copy(si, 1, Pos(decimalseparator, si) - 1); OldPrec := FPrecision; FPrecision := 0; //changed 1.8 FBlockChange := (Text <> FPrefix + neg + si + s + FSuffix); inherited Text := FPrefix + neg + si + s + fSuffix; FBlockChange := false; FPrecision := OldPrec; Diffl := Length(self.Text) - Diffl; if HandleAllocated then begin SelStart := OldSelStart + Diffl; SelLength := 0; end; end;
الرد


الردود في هذا الموضوع
عدم السماح بادخال اكثر من رقمين بعد الفاصلة - بواسطة cargem - 23-08-2012, 12:59 PM

التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم