problem with richtextbox Keypress Event
-
Hi All, I am handling keypress event for a RichTextBix control on my windows form. But, when i press a key on it, why its entering two times into keypress event code instead of once.?? I have added event handler only once on my form. could anyone please suggest me how can I overcome this problem? Thanks, Durga.
Strength is life, Weakness is death. --- Swami vivekananda
-
Hi All, I am handling keypress event for a RichTextBix control on my windows form. But, when i press a key on it, why its entering two times into keypress event code instead of once.?? I have added event handler only once on my form. could anyone please suggest me how can I overcome this problem? Thanks, Durga.
Strength is life, Weakness is death. --- Swami vivekananda
The delegate that handles the event raised has the invocation list of the methods to be called. It could be a reason that the code where the event is registered is called twice in the code execution, so check that out; the statement '+=' should be called only once when the form is loaded and the controls are created and added to it.
Muhammad Talha
-
The delegate that handles the event raised has the invocation list of the methods to be called. It could be a reason that the code where the event is registered is called twice in the code execution, so check that out; the statement '+=' should be called only once when the form is loaded and the controls are created and added to it.
Muhammad Talha