473,378 Members | 1,539 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,378 software developers and data experts.

Form1_KeyDown doesn't fire

Hi,
I have a C# from and I'm trying to add some code in onKeyDown event. But it
doesn't fire at all............

Any idea ?

Thanks a lot.
Nov 16 '05 #1
4 3095
If a control on your form has focus, your form won't receive the message unless you set KeyPreview to true.
Nov 16 '05 #2
OnKeyDown will only fire for the control that currently has focus.

However, if you want to capture it in your form, you can set the KeyPreview
property (on the form) to "true", and the OnKeyxxx events will fire for the
form, then (if you didn't cancel them) for the control.

Note that the OnKeyxxx events won't fire on the form for all keys (like the
arrow keys)

"genc ymeri" <ge********@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Hi,
I have a C# from and I'm trying to add some code in onKeyDown event. But it doesn't fire at all............

Any idea ?

Thanks a lot.

Nov 16 '05 #3
oh.....I thought I had already set that :(

thanks a lot.

"Charlie Williams" <an*******@discussions.microsoft.com> wrote in message
news:D4**********************************@microsof t.com...
If a control on your form has focus, your form won't receive the message

unless you set KeyPreview to true.
Nov 16 '05 #4
oh.....I thought I had already set that :(

thanks a lot.
"Philip Rieck" <st***@mckraken.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
OnKeyDown will only fire for the control that currently has focus.

However, if you want to capture it in your form, you can set the KeyPreview property (on the form) to "true", and the OnKeyxxx events will fire for the form, then (if you didn't cancel them) for the control.

Note that the OnKeyxxx events won't fire on the form for all keys (like the arrow keys)

"genc ymeri" <ge********@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Hi,
I have a C# from and I'm trying to add some code in onKeyDown event. But

it
doesn't fire at all............

Any idea ?

Thanks a lot.


Nov 16 '05 #5

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

Similar topics

14
by: xxbmichae1 | last post by:
I have a <select> object that i've set up an onchange event that fires in IE fine when I use the cursor up and down in the list, but If I use the cursor up and down in Firefox the event doesn't...
4
by: genc ymeri | last post by:
Hi, I have a C# from and I'm trying to add some code in onKeyDown event. But it doesn't fire at all............ Any idea ? Thanks a lot.
5
by: [Yosi] | last post by:
Hi, I add to my application the Form1_KeyDown event, But I don't go inside this function when press on the arrow keys,Any one have any Idea why it happins, Form1_KeyDown(object sender,...
3
by: KathyB | last post by:
Hi, clearly I'm just not getting something here. I have an aspx form with ONE textbox and several label controls on it. I have the textbox set to AutoPostBack = True, but when I enter my text...
7
by: Gordon Smith | last post by:
I have four (4) ASP.NET Web applications/Web sites on a IIS/6 - Windows Server 2003 production server. 3 of them work fine. I just installed the 4th one and it's Application_Start event is not...
6
by: Shimon Sim | last post by:
I have Panel control on the page. I am handling Init event for it. It doesn't seem to fire at all. Why? Thank you Shimon.
45
by: Pat | last post by:
its seems asp.net validation doesn't fire when using FireFox? Tested a page and it doesn't fire. It seems the javascript doesn't fire Any ideas?
5
by: Bob | last post by:
I've got a .NET Framework V1.1 web service running on a Windows 2003 Server that has 2 web methods that are called from a web application on the same server. One is a fire-and-forget method that...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...

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.