
如何在Delphi中用CheckBox控件对Label控件中文字字形进行设置
如何在Delphi中用CheckBox控件对Label控件中文字字形进行设置,如果CheckBox2的Checked属性为Ture则Label中的文字设为斜体,否则不为斜...
如何在Delphi中用CheckBox控件对Label控件中文字字形进行设置,如果CheckBox2的Checked属性为Ture则Label中的文字设为斜体,否则不为斜体。
展开
2个回答
展开全部
if checkbox1.Checked then
label1.Font.Style := [fsBold]
else
label1.Font.Style :=[];
if checkbox2.Checked then
label1.Font.Style := [fsitalic]
else
label1.Font.Style :=[];
label1.Font.Style := [fsBold]
else
label1.Font.Style :=[];
if checkbox2.Checked then
label1.Font.Style := [fsitalic]
else
label1.Font.Style :=[];
展开全部
var
fs: TFontStyle;
begin
if TWinControl(Sender).Name = 'CheckBox1' then
fs := fsBold
else
fs := fsItalic;
if TCheckBox(Sender).Checked then
Self.Button1.Font.Style :=
Self.Button1.Font.Style + [fs]
else
Self.Button1.Font.Style :=
Self.Button1.Font.Style - [fs];
fs: TFontStyle;
begin
if TWinControl(Sender).Name = 'CheckBox1' then
fs := fsBold
else
fs := fsItalic;
if TCheckBox(Sender).Checked then
Self.Button1.Font.Style :=
Self.Button1.Font.Style + [fs]
else
Self.Button1.Font.Style :=
Self.Button1.Font.Style - [fs];
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询