C#

Moderators: None (Apply to moderate this forum)
Number of threads: 2722
Number of posts: 5749

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
How to write event for keydown Posted by gopakumar on 7 Jul 2005 at 6:12 AM
how to write an keydown event in c#.net.
Please give me answer with code
Report
Re: How to write event for keydown Posted by hyankov on 12 Jul 2005 at 1:15 PM
: how to write an keydown event in c#.net.
: Please give me answer with code
:

In InitializeComponent():
//this hooks the keydown event to a textbox named 'textBox1'
this.textBox1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.textBox1_KeyDown);

//this is the code which will be executed on keydown
private void textBox1_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
{
//your code here
}

You don`t use the Visual Studio, do you? Why you need to do this manually?



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.