Delphi7中的一个Bug问题
在Delphi7中,预先给SpeedButton或RadioButton定义字体变换选项(如宋体,黑体,楷体),这时候我在Label中写入汉字(想通过选择SpeedBut...
在Delphi7中,预先给SpeedButton或RadioButton定义字体变换选项(如宋体,黑体,楷体),这时候我在Label中写入汉字(想通过选择SpeedButton或RadioButton定义的字体)变化,会发现字体自动缩小。如果我给字体设置初始字形、字体,则利用SpeedButton或RadioButton定义字体变换就会失效。
具体程序如下:
procedure TLXFrm307.SpeedButton1Click(Sender: TObject);
begin
label1.Font.Name:='宋体';
end;
procedure TLXFrm307.SpeedButton2Click(Sender: TObject);
begin
label1.Font.Name:='隶书';
end;
procedure TLXFrm307.SpeedButton3Click(Sender: TObject);
begin
label1.Font.Name:='黑体';
end;
procedure TLXFrm307.SpeedButton4Click(Sender: TObject);
begin
label1.Font.Name:='楷体';
end;
procedure TLXFrm307.SpeedButton5Click(Sender: TObject);
begin
if SpeedButton5.Down then
label1.Font.Style:=label1.Font.Style+[fsBold]
else
label1.Font.Style:=label1.Font.Style-[fsBold];
end;
procedure TLXFrm307.SpeedButton6Click(Sender: TObject);
begin
if SpeedButton6.Down then
label1.Font.Style:=label1.Font.Style+[fsItalic]
else
label1.Font.Style:=label1.Font.Style-[fsItalic];
end;
procedure TLXFrm307.SpeedButton7Click(Sender: TObject);
begin
if SpeedButton7.Down then
label1.Font.Style:=label1.Font.Style+[fsunderline]
else
label1.Font.Style:=label1.Font.Style-[fsunderline];
end;
end. 展开
具体程序如下:
procedure TLXFrm307.SpeedButton1Click(Sender: TObject);
begin
label1.Font.Name:='宋体';
end;
procedure TLXFrm307.SpeedButton2Click(Sender: TObject);
begin
label1.Font.Name:='隶书';
end;
procedure TLXFrm307.SpeedButton3Click(Sender: TObject);
begin
label1.Font.Name:='黑体';
end;
procedure TLXFrm307.SpeedButton4Click(Sender: TObject);
begin
label1.Font.Name:='楷体';
end;
procedure TLXFrm307.SpeedButton5Click(Sender: TObject);
begin
if SpeedButton5.Down then
label1.Font.Style:=label1.Font.Style+[fsBold]
else
label1.Font.Style:=label1.Font.Style-[fsBold];
end;
procedure TLXFrm307.SpeedButton6Click(Sender: TObject);
begin
if SpeedButton6.Down then
label1.Font.Style:=label1.Font.Style+[fsItalic]
else
label1.Font.Style:=label1.Font.Style-[fsItalic];
end;
procedure TLXFrm307.SpeedButton7Click(Sender: TObject);
begin
if SpeedButton7.Down then
label1.Font.Style:=label1.Font.Style+[fsunderline]
else
label1.Font.Style:=label1.Font.Style-[fsunderline];
end;
end. 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询