///////////////////////////////////////////////////////
//ÒÔÏÂΪÉèÖñí¸ñÖÐÊýÖµ¸ñʽ
//////////////////////////////////////////////////////
procedure TForm1.ToolButton32Click(Sender: TObject);
var
s:string;
cellformat:f1cellformat;
begin
cellformat:=fbook1.getcellformat;
s:=cellformat.NumberFormat[fbook1.handle];
if pos('.',s)<>0 then cellformat.NumberFormat[fbook1.handle]:=s+'0'
else
cellformat.NumberFormat[fbook1.handle]:='#.0';
fbook1.SetCellFormat(cellformat);
end;
procedure TForm1.ToolButton33Click(Sender: TObject)
//&frac14;&Oacute;&ETH;&iexcl;&Ecirc;&yacute;&micro;&atilde;
var
i:integer;
s,s2,s3,s4:string;
cellformat:f1cellformat;
begin
cellformat:=fbook1.getcellformat;
s:=cellformat.NumberFormat[fbook1.handle];
i:=length(s);
s2:=copy(s,1,pos('.',s)-1);
s3:=copy(s,pos('.',s),i-pos('.',s));
if s3<>'.' then
s4:=s2+s3
else
s4:=s2;
cellformat.NumberFormat[fbook1.handle]:=s4;
fbook1.SetCellFormat(cellformat);
end;
procedure TForm1.ToolButton38Click(Sender: TObject);
var
r1,c1,r2,c2:integer;
begin
fbook1.getselection(0,r1,c1,r2,c2);
fbook1.ObjCreate(5,r1,c1,r2,c2);
fbook1.ObjBringToFront
end;
procedure TForm1.ToolButton39Click(Sender: TObject);
var
cellformat:f1cellformat;
s,s1:string;
i,j,r1,r2,c1,c2:integer;
cellvalue:double;
begin
s1:='#,###.';
fbook1.GetSelection(0,r1,c1,r2,c2);
cellvalue:=fbook1.numberrc[r1,c1];
cellformat:=fbook1.GetCellFormat;
s:=cellformat.NumberFormat[fbook1.handle];
if pos(',',s)<>0 then
begin
if pos('.',s)<>0 then cellformat.NumberFormat[fbook1.handle]:='###'+copy(s,pos('.',s),length(s)-pos('.',s)+1)
else
cellformat.NumberFormat[fbook1.handle]:='###';
end
else
begin
if s='General'then
begin
if pos('.',floattostr(cellvalue))=0 then cellformat.NumberFormat[fbook1.handle]:='#,###'
else
begin
i:=length(floattostr(cellvalue));
for j:=1 to i-pos('.',floattostr(cellvalue)) do
begin
s1:=s1+'0';
end;
cellformat.NumberFormat[fbook1.handle]:=s1;
end;
end
else
cellformat.NumberFormat[fbook1.handle]:='#,###'+copy(s,pos('.',s),length(s)-pos('.',s)+1);
end;
fbook1.SetCellFormat(cellformat);
end;
////////////////////////////////////////////////////////////////
//&Ograve;&Ocirc;&Eacute;&Iuml;&Icirc;&ordf;±í&cedil;&ntilde;&Ouml;&ETH;&micro;&Auml;&Ecirc;&yacute;&Ouml;&micro;&cedil;&ntilde;&Ecirc;&frac12;&micro;&Auml;&Eacute;è&Ouml;&Atilde;
/////////////////////////////////////////////////////////////////