Changing Background and Textcolor for a custom Dark Theme

SyntaxEditor for Windows Forms Forum

Posted 7 months ago by Jafran Majeau
Version: 20.1.0400
Avatar

Hello, I've made some research to make sure I wasn't asking something that was already posted, but the most relevant post I found were 12 years old, so I figured I might need something more recent.

I've been trying to use the ActiproSoftware.SyntaxEditor.SyntaxEditor control, and I have a multiple color themes setup.

When I try to change the this.myEditor.ForeColor or this.myEditor.BackColor (myEditor being an aforementioned SyntaxEditor), nothing seems to change. I'm essentially trying to have the editor fit the different themes (for example, Dark Theme by changing the background color to black and the text color to white). Is there a way to get this result?

I apologize if this is something that's already been explained.

Comments (1)

Answer - Posted 7 months ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

In the most recent 2020.1 version, we updated the SyntaxEditor codebase to use a similar setup to the newer WPF and UWP versions in terms of how text is highlighted.

You would want to read through the "SyntaxEditor / User Interface Features / Theme and Highlighting Style Features / Highlighting Style Registries" topic in the documentation that comes with the product.  That explains how it works.

Basically there is a highlighting style registry.  You register a highlighting style for each classification type (keyword, string, etc.) and the colors in the styles get used for syntax highlighting.  We also have numerous special "display" classification types for things like plain text (the default foreground/background, margins, whitespace, etc.) that you can register styles for.

Those should allow you to customize the entire appearance of the editor.  The one thing we know we still have to do is allow the scrollbars to render differently in custom themes.  That is a high priority TODO item for the next build.  We also want to wire it up so that ForeColor/BackColor can override the plain text display classification type style registration.


Actipro Software Support

The latest build of this product (v2020.1 build 0401) was released 4 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.