What does setting to e.Handled = True in OnKeyUp do?

D

**Developer**

I have a usercontrol that contains the following.

To my surprise the form containing this control get KeyUp events.

Help says that for KeyPress setting e.Handled = True suppresses KeyPress
events but say very little about KeyUp.

What does setting to Handled do?



In the Control I also continue to get KeyPress and KeyUp events.

In them I also have the same code to set e.Handled = True

Thanks



Protected Overrides Sub OnKeyUp(ByVal e As
System.Windows.Forms.KeyEventArgs)

If mReadOnly Then

e.Handled = True

Else

snip...

End If

MyBase.OnKeyUp(e)

End Sub
 
R

Robin Tucker

Same thing. Suppresses the event from there onwards. ie. other controls
wanting it won't get it.
 
D

**Developer**

But that's my confusion. I get the event on the form after I set e.Handled =
True in the control.

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top