procedure TCmdForm.btnBoldClick(Sender: TObject);
begin
if PageControl1.PageCount>0 then
begin
if (fsBold in SelFontFormat.Style = False)
then begin // not in
Richmemo1.SetRangeParams (Richmemo1.SelStart, // int: begin position of selection, 0 sets start of file.
Richmemo1.SelLength, // int: length of selection characters, -1 sets end of file.
[tmm_Styles], // cst: modify types, [] sets to empty, or [tmm_Styles,tmm_Color]
'', // str: font name, '' sets to empty.
0, // int: font size, 0 sets to empty.
0, // int: color, 0 sets to empty.
[fsBold], // cst: adding styles, [] sets to empty, or [fsBold,fsItalic]
[] // cst: remove styles, [] sets to empty, or [fsBold,fsItalic]
);
showmessage('Made it Bold'); // test for proving entry
end
else begin // is in
Richmemo1.SetRangeParams (Richmemo1.SelStart, // int: begin position of selection, 0 sets start of file.
Richmemo1.SelLength, // int: length of selection characters, -1 sets end of file.
[tmm_Styles], // cst: modify types, [] sets to empty, or [tmm_Styles,tmm_Color]
'', // str: font name, '' sets to empty.
0, // int: font size, 0 sets to empty.
0, // int: color, 0 sets to empty.
[], // cst: adding styles, [] sets to empty, or [fsBold,fsItalic]
[fsBold] // cst: remove styles, [] sets to empty, or [fsBold,fsItalic]
);
showmessage('Removed Bold'); // test for proving entry
end;
Richmemo1.Repaint;
Richmemo1.SetFocus;
end;