I'm using a user control I created as a SQL syntax editor. However, all text is black and white.
XML Header
<SyntaxLanguage Key="SQL" LanguageDefinitionVersion="4.0" Secure="True" WordContainsAdditionalCharacters="@_" SyntaxLanguageTypeName="SqlBrowser.SqlDynamicSyntaxLanguage, SqlBrowser" xmlns="http://ActiproSoftware/SyntaxEditor/4.0/LanguageDefinition">
namespace SqlBrowser
{
public partial class SQLEditor : UserControl
...
Source code for _Load method
ctlSQL_Editor.Dock = DockStyle.Fill;
DynamicSyntaxLanguage DOSL = new DynamicSyntaxLanguage("SQL", true);
ctlSQL_Editor.Document.LanguageData = DOSL;
ctlSQL_Editor.Document.LoadLanguageFromXml("ActiproSoftware.SQL.xml", 0);
ctlSQL_Editor.Focus();
The code works in the main form. Do I need to have a second XML file for the user control? Is there a limit to the number of Editors per application?
Main form Form_Load method
rtbSqlEditor.Document.LoadLanguageFromXml("ActiproSoftware.SQL.xml", 0);
rtbScript.Document.LoadLanguageFromXml("ActiproSoftware.SQL.xml", 0);
These controls work fine.
[Modified at 04/26/2009 11:48 PM]
XML Header
<SyntaxLanguage Key="SQL" LanguageDefinitionVersion="4.0" Secure="True" WordContainsAdditionalCharacters="@_" SyntaxLanguageTypeName="SqlBrowser.SqlDynamicSyntaxLanguage, SqlBrowser" xmlns="http://ActiproSoftware/SyntaxEditor/4.0/LanguageDefinition">
namespace SqlBrowser
{
public partial class SQLEditor : UserControl
...
Source code for _Load method
ctlSQL_Editor.Dock = DockStyle.Fill;
DynamicSyntaxLanguage DOSL = new DynamicSyntaxLanguage("SQL", true);
ctlSQL_Editor.Document.LanguageData = DOSL;
ctlSQL_Editor.Document.LoadLanguageFromXml("ActiproSoftware.SQL.xml", 0);
ctlSQL_Editor.Focus();
The code works in the main form. Do I need to have a second XML file for the user control? Is there a limit to the number of Editors per application?
Main form Form_Load method
rtbSqlEditor.Document.LoadLanguageFromXml("ActiproSoftware.SQL.xml", 0);
rtbScript.Document.LoadLanguageFromXml("ActiproSoftware.SQL.xml", 0);
These controls work fine.
[Modified at 04/26/2009 11:48 PM]