Form dengan checkbox untuk mengubah font style
LISTING FONT STYLE MENGGUNAKAN CHECKBOX:
procedure TForm1.CheckBox1Click(Sender: TObject);
begin
if checkbox1.Checked=true then memo1.Font.Style:=memo1.Font.Style+[fsbold]
else memo1.Font.Style:=memo1.Font.Style-[fsbold];
end;
procedure TForm1.CheckBox2Click(Sender: TObject);
begin
if checkbox2.Checked=true then memo1.Font.Style:=memo1.Font.Style+[fsitalic]
else memo1.Font.Style:=memo1.Font.Style-[fsitalic];
end;
procedure TForm1.CheckBox3Click(Sender: TObject);
begin
if checkbox3.Checked=true then memo1.Font.Style:=memo1.Font.Style+[fsUnderline]
else memo1.Font.Style:=memo1.Font.Style-[fsUnderline];
end;
end.
begin
if checkbox1.Checked=true then memo1.Font.Style:=memo1.Font.Style+[fsbold]
else memo1.Font.Style:=memo1.Font.Style-[fsbold];
end;
procedure TForm1.CheckBox2Click(Sender: TObject);
begin
if checkbox2.Checked=true then memo1.Font.Style:=memo1.Font.Style+[fsitalic]
else memo1.Font.Style:=memo1.Font.Style-[fsitalic];
end;
procedure TForm1.CheckBox3Click(Sender: TObject);
begin
if checkbox3.Checked=true then memo1.Font.Style:=memo1.Font.Style+[fsUnderline]
else memo1.Font.Style:=memo1.Font.Style-[fsUnderline];
end;
end.
0 komentar:
Posting Komentar