• Offizieller Beitrag
    Zitat

    Is there a way to type into a label?

    The TWPRichTextLabel does not have a window, it is just a TGraphic control. So it does not have any focus handling and also does not capture Keyboard events.

    Since typing is usually not required into a label there is no clipboard handling either.

    BUT - it has the powerful Cursor object which is also used by the TWPRichText and TWPCustomRTFEdit class.

    And this makes it actually possible and quite easy to implement the ability to type into a TWPRichText label.

    You only need a control which captures the keyboard events. With property KeyPreview = true this can also be a TForm.

    You need a PaintBox to paint the caret since the label does not do this. The PaintBox is the top most element.

    And You need some event handler.

    The demo project can be downloaded here:
    https://www.wpcubed.com/ftp/ex/type_in_RTF_label.zip

    It is based on this: