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

System.KeyPressEventHandler (does it exist?)



Hi,

I know there is a textBox1_KeyPress event, but what is the name should I
put after the
InitializeComponent()
this.textBox1.KeyPress += new
System.KeyPressEventHandler(this.textBox1_KeyPress ); -- C# said the
error below:
The type or namespace name 'KeyPressEventHandler' does not exist in the
class or namespace 'System' (are you missing an assembly reference?)

Can someone tell me what is the correct word??

Cheers!

Claudi

*** Sent via Developersdex http://www.developersdex.com ***
Nov 17 '05 #1
2 4433
Hello,
KeyPressEventHandler is not a part of System namespace.It is a part of
System.Windows.Forms namespace. You can put it like this:

textBox1.KeyPress += new
System.Windows.Forms.KeyPressEventHandler(this.tex tBox1_KeyPress);

HTH. Cheers :)
Maqsood Ahmed [MCP,C#]
Kolachi Advanced Technologies
http://www.kolachi.net

*** Sent via Developersdex http://www.developersdex.com ***
Nov 17 '05 #2
Hello,
KeyPressEventHandler is not a part of System namespace.It is a part of
System.Windows.Forms namespace. You can put it like this:

textBox1.KeyPress += new
System.Windows.Forms.KeyPressEventHandler(this.tex tBox1_KeyPress);

HTH. Cheers :)
Maqsood Ahmed [MCP,C#]
Kolachi Advanced Technologies
http://www.kolachi.net

*** Sent via Developersdex http://www.developersdex.com ***
Nov 17 '05 #3

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

Similar topics

0
by: Claudia Fong | last post by:
Hi, I know there is a textBox1_KeyPress event, but what is the name should I put after the InitializeComponent() this.textBox1.KeyPress += new...
16
by: lawrence k | last post by:
I've a file upload script on my site. I just now used it to upload a small text document (10k). Everything worked fine. Then I tried to upload a 5.3 meg Quicktime video. Didn't work. I've...
0
by: Kirk | last post by:
I'm trying to use a Web Service to be a Remoting client of an existing ..NET 2.0 server. But I get the following error when I try to use System.Runtime.Remoting.Channels.Http in my WebService. ...
7
by: tongueless | last post by:
Whenever I have "using System.Windows.Forms.VisualStyles" in any project, VS2005 tells me that "'VisualStyles' does not exist in the namespace 'System.Windows.Forms.' Any idea what this might be?...
5
by: Peter Bradley | last post by:
I'm trying to use System.DirectoryServices to update Active Directory from a Web Service. When I try to commit the changes, I get the following error message: "A constraint violation occurred....
14
by: Ronald S. Cook | last post by:
I'm just curious how you would handle this. In the cable industry, Comcast is referred to as an "MSO" (multiple systems operator) meaning they own many cable systems. Therefore a solution must be...
0
by: Tommy | last post by:
my KeyPressEventHandler does not work in my form. I have searched the forum, but nothing seems to be similar to my issue. Can anyone please help. public partial class Form_Cust : Form { public...
2
by: jparulan | last post by:
Hi All, I am developing web service that does not use IIS, I was successful on deploying a normal web service with System.Data and System.Web namespaces. BUT when I added the...
0
by: acidedgeuk | last post by:
Hi, I am adding a large number of files to the target machine using an MSI installer created in VS 2008. I am having problems with the launch conditions. What I want is a way to prevent files...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.