In EG 4.1, the assemblies have the "SAS." prefix in their names.
I don't recommend using the designer to deal with the enhanced editor control. Instead, I would use a placeholder control (like a panel) and then dynamically create the editor control when your form is loaded.
For example, declare this:
[pre]
private AxEDITORCONTROLLib.AxEditorControl ctlEditor = null;
[/pre]
Then in OnLoad(), do this:
[pre]
ctlEditor = new AxEDITORCONTROLLib.AxEditorControl();
ctlEditor.Location = panelPlaceholder.Location;
ctlEditor.Visible = true;
ctlEditor.Dock = panelPlaceholder.Dock;
// add handler for when the control is finished being created
ctlEditor.HandleCreated += new EventHandler(ctlEditor_HandleCreated);
this.Controls.AddRange(new System.Windows.Forms.Control[] {this.ctlEditor});
[/pre]
Then be sure not to reference the control's methods until the handle is created. This is not uncommon when dealing with ActiveX controls via COM interop. It might take a moment to initialize, and you cannot call into it before it's ready.
[pre]
// control is created - now open file
private void ctlEditor_HandleCreated(object sender, EventArgs e)
{
if (file.Length>0)
ctlEditor.OpenFile(file);
ctlEditor.SetLanguage(4); // set language to SAS for syntax coloring
}
[/pre]
Chris
... View more