|
This one demonstrate both CheckBox tool and how to change Font Style
at runtime.

Download this example
Update
button - on click event
procedure TForm1.Button1Click(Sender: TObject);
begin
{ Clear previous font style, this step is
not necessary }
Panel1.Font.Style:=[];
{ Check for Bold option }
if CheckBox1.Checked Then
Panel1.Font.Style:=Panel1.Font.Style+[fsBold]
Else
Panel1.Font.Style:=Panel1.Font.Style-[fsBold];
{ Check for Italic option }
if CheckBox2.Checked Then
Panel1.Font.Style:=Panel1.Font.Style+[fsItalic]
Else
Panel1.Font.Style:=Panel1.Font.Style-[fsItalic];
{ Check fro underline option }
if CheckBox3.Checked Then
Panel1.Font.Style:=Panel1.Font.Style+[fsUnderline]
Else
Panel1.Font.Style:=Panel1.Font.Style-[fsUnderline];
end;
DOWNLOAD this example
Click
here
to download this complete example for Delphi 6. (File size 4 KB)

|