Combobox Color

  • We do insert tables programatical into wptools. The Colors are selected by TWPCombos. These are limited to 16 colors. We would like to use
    all colors to select from like in the editor Toolbar. Color ist stored by the index (colorbynr).

    How can we select the Numbers seeing all the colors. How do the index-numbers connect to all the colors (or do the connect anyway) ?

    Chuck

    • Offizieller Beitrag

    You cannot use the TWPCombos for this since it only lists the colors which are used by the text already. There are color drop down component availoable on the market.

    You can use any color in the text but you need to add it to the RTF text to use it.

    This is done by the function
    WPRichText.GetColorNr(aColor: TColor): Integer;

    The result value it the color index which can then be used.

  • Thank you for the answer.

    I used another way, which is compatible with WPTools-Colors.

    I made a little frame with a wprichedit, a rich label and a toolbar with color,bicolor buttons.
    So i have the preview automatically and i have the same selection of colors as in the editor.