473,385 Members | 1,908 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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

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
Nov 21 '05 #1
2 3043
Same thing. Suppresses the event from there onwards. ie. other controls
wanting it won't get it.

" **Developer**" <RE*************@a-znet.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
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

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

Thanks

"Robin Tucker" <id*************************@reallyidont.com> wrote in
message news:da*******************@news.demon.co.uk...
Same thing. Suppresses the event from there onwards. ie. other controls
wanting it won't get it.

" **Developer**" <RE*************@a-znet.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
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


Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Jaime Rios | last post by:
Hi, I created a COM AddIn for Word that performs the functions that it needs to, but I needed to add the ability for the toolbar created by the COM AddIn to remember it's last position and...
3
by: Trent | last post by:
Hi. I know the basic way to assign event handlers: <input onKeyUp="processEvent(event)" /> But how do I assign a function to the onKeyUp event in *javascript* that can access the event...
2
by: Evan Wong | last post by:
I have problem to get onkeyup event. If we put the event in HTML statement like - "<input name=field1 size=16 onkeyup="javascript:function1();>" it works. If we put in JavaScript code like...
121
by: typingcat | last post by:
First of all, I'm an Asian and I need to input Japanese, Korean and so on. I've tried many PHP IDEs today, but almost non of them supported Unicode (UTF-8) file. I've found that the only Unicode...
6
by: Roman Mashak | last post by:
Hello, All! I'm trying to set up macro: .... int main(int argc, char *argv, char *envp) { .... if ( argc > 1 ) { if ( strcmp(argv, "-d") == 0 ) {
9
by: Jay | last post by:
Everywhere I go (read/browse) I see these parameters.... ByVal sender As Object, ByVal e As System.EventArgs Yet I never see them used within the function/method. Could someone tell me what they...
4
by: **Developer** | last post by:
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...
7
by: Papelotte | last post by:
Hi all, I'm new to this forum and I am hoping that there is someone here who can help me. I have an ASP page that has javascript that works perfectly in IE, but not in Firefox. Can anybody tell...
11
by: =?Utf-8?B?UmF5IE1pdGNoZWxs?= | last post by:
Hello, I know I sound like a one-note Johnny on this but I'm still looking for a solution. I need to display characters coming in from a serial port or a socket. I also need to be able to type...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.