trigger event not firing

SyntaxEditor for Windows Forms Forum

Posted 18 years ago by luis molina
Avatar
hi, ive downloaded the trial and the demos are working , but if i make my own project i have language support (c#) but the event editor_Trigger its not working neither editor_KeyTyping event; the editor_Click event its working. please help me.

Comments (6)

Posted 18 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Any time a KeyPress or KeyDown event occurs, they call KeyTyping. So your app might be filtering out keys so they never reach the control. Either that or your event handler ties were broken in your code. Look at one of those two things.


Actipro Software Support

Posted 18 years ago by luis molina
Avatar
hi, thanks, but the problem should be that in my code there is not event handlers, i have put the control (working) and the code for the event, but the only thing i do is initialize the control

code:

private void Form1_Load(object sender, EventArgs e)
{
// Get the project path
projectPath = Path.GetFullPath(Path.GetDirectoryName(Application.ExecutablePath) + @"\..\..\");
languagePath = projectPath + @"Languages\";
// Load from XML
editor.Document.LoadLanguageFromXml(languagePath + "ActiproSoftware.CSharp.xml", 0);


// Load the reflection ImageList
reflectionImageList = SyntaxEditor.ReflectionImageList;


}



/// <summary>
/// Occurs before a key is typed.
/// </summary>
/// <param name="sender">Sender of the event.</param>
/// <param name="e">Event arguments.</param>
private void editor_KeyTyping(object sender, ActiproSoftware.SyntaxEditor.KeyTypingEventArgs e)
{
// Add status message
// this.WriteLine("KeyTyping: " + e.ToString());

if (e.KeyChar == '(')
{
Posted 18 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
What I was asking is if you are positive you have a line like this in your InitializeComponent code for the form:
this.editor.KeyTyping += new KeyTypingEventHandler(editor_KeyTyping);
If that isn't there then the event will never be called.


Actipro Software Support

Posted 18 years ago by luis molina
Avatar
i supposed it was the problem, that its not in my code. the problem is :
1. i cant see this in the examples
2. dont know the class of KeyTypingEventHandler. (i suppose i miss a dll or using..)
Posted 18 years ago by luis molina
Avatar
well i have found it in the example and with this syntax its working...


this.editor.KeyTyping += new ActiproSoftware.SyntaxEditor.KeyTypingEventHandler(this.editor_KeyTyping);
this.editor.Trigger += new ActiproSoftware.SyntaxEditor.TriggerEventHandler(this.editor_Trigger);


many thanks.
Posted 18 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Yes that's how you wire up events in C#. In VB you don't need to do that.


Actipro Software Support

The latest build of this product (v24.1.0) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.