Make an onchange for wizardform.diredit to update changes.
How to do one,
Code:
procedure DirEditOnChange(Sender: TObject);
begin
lbl.caption:= ExpandConstant('Espaço do Game : ') + MbOrTb(24000);
end;
WizardForm.DirEdit.OnChange:= @DirEditOnChange;
to add the two decimals use this mbortb
Code:
Function NumToStr(Float: Extended): String;
Begin
Result:= Format('%.2n', [Float]); StringChange(Result, ',', ',');
while ((Result[Length(Result)] = '0') or (Result[Length(Result)] = ',')) and (Pos(',', Result) > 0) do
SetLength(Result, Length(Result)-1);
End;
function MbOrTb(Float: Extended): String;
begin
if Float < 1024 then Result:= NumToStr(Float)+' '+ 'MB'else
if Float/1024 < 1024 then Result:= NumToStr(Float/1024)+' '+'GB' else
Result:= NumToStr(Float/(1024*1024))+' '+'TB';
end;