Demonstrates how to use CheckBox and Font Style in Delphi

Demonstrates how to use CheckBox and Font Style in Delphi

Demonstrates how to use CheckBox and Font Style in Delphi

Demonstrates how to use CheckBox and Font Style in Delphi

DownloadDownload This Tutorials

Bookmark:

Demonstrates how to use CheckBox and Font Style in Delphi

This is same as previous example. But uses more dynamic system to illustrate how to change Font Style using CheckBox on click event.

demonstrates how to use CheckBox and Font Style in Delphi

Setup CheckBoxes on click events as :

procedure TForm1.CheckBox1Click(Sender: TObject);
begin
   If CheckBox1.Checked Then
        Panel1.Font.Style:=Panel1.Font.Style+[fsBold]
   Else
        Panel1.Font.Style:=Panel1.Font.Style-[fsBold];
end;



procedure TForm1.CheckBox2Click(Sender: TObject);
begin
    if CheckBox2.Checked Then
         Panel1.Font.Style:=Panel1.Font.Style+[fsItalic]
    Else
         Panel1.Font.Style:=Panel1.Font.Style-[fsItalic];
end;

procedure TForm1.CheckBox3Click(Sender: TObject);
begin
    if CheckBox3.Checked Then
         Panel1.Font.Style:=Panel1.Font.Style+[fsUnderline]
    Else
         Panel1.Font.Style:=Panel1.Font.Style-[fsUnderline];
end;

Download This Delphi Tutorials.

Download materials for this article (Delphi - Tutorials)

Download - CheckBox-OnClick.zipCheckBox-OnClick.zip
       File size: 4 KB, File type: zip
       Total downloads: 178, Upload date: February 02 - 2009

Leave a comment