Property VisualThemeType
VisualThemeType
Gets or sets visual theme type for the editor.
public VisualThemeType VisualThemeType { get; set; }
Property Value
Examples
Here is how to set a VisualThemeType different VisualThemeType from the C# code:
public partial class Form1 : Form
{
private void Form1_Load(object sender, EventArgs e)
{
var syntaxEdit1 = new Alternet.Editor.SyntaxEdit(this.components);
syntaxEdit1.VisualThemeType = Alternet.Editor.VisualThemeType.Custom;
syntaxEdit1.VisualTheme = CustomVisualTheme.Instance;
}
}
public class CustomVisualTheme
: Alternet.Editor.StandardVisualTheme
{
public static readonly CustomVisualTheme Instance = new CustomVisualTheme();
public CustomVisualTheme()
: base("Custom")
{
}
protected override VisualThemeColors GetColors()
{
var colors = DarkVisualTheme.Instance.Colors.Clone();
colors.Reswords = Color.Red;
colors.WindowBackground = Color.FromArgb(40, 40, 40);
return colors;
}
}
Here is how to set a VisualThemeType different VisualThemeType from the Visual Basic code:
Partial Public Class Form1
Inherits Form
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)
Dim syntaxEdit1 = New Alternet.Editor.SyntaxEdit(Me.components)
syntaxEdit1.VisualThemeType = Alternet.Editor.VisualThemeType.Custom
syntaxEdit1.VisualTheme = CustomVisualTheme.Instance
End Sub
End Class
Public Class CustomVisualTheme
Inherits Alternet.Editor.StandardVisualTheme
Public Shared ReadOnly Instance As CustomVisualTheme = New CustomVisualTheme()
Public Sub New()
MyBase.New("Custom")
End Sub
Protected Overrides Function GetColors() As VisualThemeColors
Dim Colors As VisualThemeColors = DarkVisualTheme.Instance.Colors.Clone()
Colors.Reswords = Color.Red
Colors.WindowBackground = Color.FromArgb(40, 40, 40)
Return Colors
End Function
End Class
Remarks
Gets or sets visual theme type that specifies fonts and colors for all SyntaxEdit visual elements and dialog boxes.
Possible values are None, Light, Dark, and Custom. Custom type allows specifying a user-defined set of fonts and colors.