N nnyxm Unregistered / Unconfirmed GUEST, unregistred user! 2001-12-11 #1 设定Edit的Maxlenth为10,如何判断当输入<10时,在前面用"0"填充?
D dpfans Unregistered / Unconfirmed GUEST, unregistred user! 2001-12-11 #2 var s:string; begin s:=edit1.text; edit1.text:=format('%.10',);
W wsn Unregistered / Unconfirmed GUEST, unregistred user! 2001-12-11 #3 输入什么型的数据呀? 笨一点的方法是 转成 string就好加了
Z zhihuali Unregistered / Unconfirmed GUEST, unregistred user! 2001-12-11 #5 procedure TForm1.Edit1Exit(Sender: TObject); var S:String; begin S:=Edit1.Text; if Length(S)<10 then begin S:='0000000000'+S; Edit1.Text:=Copy(S,Length(S)-9,10); end; end;
procedure TForm1.Edit1Exit(Sender: TObject); var S:String; begin S:=Edit1.Text; if Length(S)<10 then begin S:='0000000000'+S; Edit1.Text:=Copy(S,Length(S)-9,10); end; end;
B bluerain Unregistered / Unconfirmed GUEST, unregistred user! 2001-12-11 #7 var s : string; i : integer; begin s := edit1.text; if length(s) < 10 then for i := 1 to 10-length(s) do edit1.text := '0' + edit1.text; end;
var s : string; i : integer; begin s := edit1.text; if length(s) < 10 then for i := 1 to 10-length(s) do edit1.text := '0' + edit1.text; end;
Y YNTW Unregistered / Unconfirmed GUEST, unregistred user! 2001-12-11 #10 procedure TForm1.Edit1Exit(Sender: TObject); begin Edit1.Text:=Format('0000000000',StrToInt(Edit1.Text)); end;
procedure TForm1.Edit1Exit(Sender: TObject); begin Edit1.Text:=Format('0000000000',StrToInt(Edit1.Text)); end;