Limit the color selection in c1editor

Posted by: ronie.soriano on 16 February 2021, 12:47 am EST

    • Post Options:
    • Link

    Posted 16 February 2021, 12:47 am EST

    I want to limit the color selection in c1editor like black, blue and red only

  • Posted 16 February 2021, 6:39 pm EST

    Hi,

    As we understand, you want to limit the colors users can select from the C1EditorToolStripStyle for the C1Editor. Although this can not be achieved directly, you can do this by removing the default color pickers and adding custom tool strip items for picking colors. You can use the Remove() and Insert() method of the ToolStripItemCollection of C1EditorToolStripStyle to remove old items and add new items. Then you can use the CreateRange method of C1editor to get the text range you want to change the color of. Once you have the text range, you can then use the ApplyStyle method of C1TextRange to apply the colors. Please refer to the sample attached.

    Regards.

    Avnish

    C1EditorlimitColors.zip

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels