I get on a other post a routine similar to this, to control CTRL+B:
Code
procedure TFrmEditorSimple.DBWPRT_LOCALEDITORKeyDown(Sender: TObject;
var Key: Word; Shift: TShiftState);
var
bToggle: Boolean;
begin
with DBWPRT_LOCALEDITOR do
begin
bToggle := (Key in [Integer('B'), Integer('U'), Integer('I')])
and (Shift = [ssctrl]);
if bToggle then
Changing;
if bToggle and (Key = Integer('B')) then
TextCursor.CurrAttribute.ToggleCharstyle(WPSTY_BOLD)
else if (Key = Integer('I')) then
TextCursor.CurrAttribute.ToggleCharstyle(WPSTY_ITALIC)
else if (Key = Integer('U')) then
TextCursor.CurrAttribute.ToggleCharstyle(WPSTY_UNDERLINE);
if bToggle then
Key := 0;
end;
end;
Alles anzeigen
But there is a problem here. If I dont have nothing selected, then I press Ctrl+B the words show me BOLD, this is ok, but when I post the record the \b not put around the text that i write after i pressed CTRL+B.
If I select some word on text and press CTRL+B then all works!
What the problem?