Wrong behaivor Ctrl+B

  • I get on a other post a routine similar to this, to control CTRL+B:

    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?

  • No julian, I have used wprichtext no dbaware and I have the same behavior.
    Follow this steps:

    Teste 1:
    typesome text, press CTRL+B, type more text, press CTRL+B
    Result of Wprich.AsString on Teste 1
    {\rtf1\ansi\...
    {\plain\fs24 mvm\b mvmvmvmvm\b0 \par }}

    Teste 2:
    typesome text, press CTRL+B, type more text, DON'T press CTRL+B again
    Result of Wprich.AsString on Teste 2
    {\rtf1\ansi\...
    {\plain\fs24 mvm mvmvmvmvm\par }}

  • 5.20.4

    WPRichText1.TextCursor.CurrAttribute.ToggleCharstyle(...) just work if there is a selection or if your press shortcut, type something and press the shortcut again.

    Put 2 wprichtexts, 2 buttons and 1 memo on form:
    1) type something at wpr1;
    2) press CTRL+B;
    3) type some word at wpr1 yet (it will set to bold)!
    but....
    4) click on btn1 (memo1.lines.text := wpr1.asstring)
    3) click on btn2 (wpr2.asstring := memo1.lines.text)

    U will see that the bold text not is show on wpr2.