469,602 Members | 1,932 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,602 developers. It's quick & easy.

how to suppress an event?

Is there any way to suppress an event method?

i got Enter & leave Events on two groupBoxs, they r " private void groupBox1_Enter(object sender, System.EventArgs e)" and private void groupBox1_Leave(object sender, System.EventArgs e) event methods, from msdn info the order of execution for them will be
1> Enter
2>GotFocus
3>lost focus
4>Leave
5>Validating

i used only Enter and Leave events, after entering a groupBox i can see that "Enter" event has been fired but when i fire a gui event with my mouse click, Leave event is not getting activated. so i manually activating that event method, but in some situations its getting activated too many time.
if the above info is too confusing just answer this Question "can i cancel an event before its getting activated?".

Nov 15 '05 #1
1 9085
Hi seash,

I think you run into one of the well known bugs in the framework. The
sequence of events you provided is what it has to be. Due to a bug in the
framework it happens only if the focus is switched using the *Tab* key.

To answer your question I would say there is no way to stop a control to
raise an event. If it is control written by yourself or control that you
inherit from any of the windows forms controls you can override event's
corresponding OnXXXX method and if you don't want the event to be fired
don't call the base implementation (base.OnXXXX). I don't think it solves
your problem, though.

--
B\rgds
100

"seash" <an*******@discussions.microsoft.com> wrote in message
news:47**********************************@microsof t.com...
Is there any way to suppress an event method?

i got Enter & leave Events on two groupBoxs, they r " private void groupBox1_Enter(object sender, System.EventArgs e)" and private void
groupBox1_Leave(object sender, System.EventArgs e) event methods, from
msdn info the order of execution for them will be 1> Enter
2>GotFocus
3>lost focus
4>Leave
5>Validating

i used only Enter and Leave events, after entering a groupBox i can see that "Enter" event has been fired but when i fire a gui event with my mouse
click, Leave event is not getting activated. so i manually activating that
event method, but in some situations its getting activated too many time. if the above info is too confusing just answer this Question "can i cancel an event before its getting activated?".

Nov 15 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by theintrepidfox | last post: by
7 posts views Thread by Marco Roberto | last post: by
5 posts views Thread by Luke Skywalker | last post: by
4 posts views Thread by =?Utf-8?B?UmljaA==?= | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.