Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 2005 > C# 2005
|
C# 2005 For discussion of Visual C# 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 16th, 2007, 04:56 AM
Friend of Wrox
 
Join Date: May 2005
Posts: 140
Thanks: 0
Thanked 0 Times in 0 Posts
Default ESC button as Access Key

Hallo all,

I am a java programmer and I am quite new in C# 2005 area. What I want to do is to add ESC Key as an access key to my Cancel button. It means if the user hits on ESC key the form should be closed. Can anyone help me?

Your attitude determines your altitude
__________________
Your attitude determines your altitude
 
Old January 18th, 2007, 02:38 PM
Friend of Wrox
 
Join Date: Dec 2006
Posts: 176
Thanks: 0
Thanked 0 Times in 0 Posts
Default

this is veryy sample
on the form on keyPress event type


if(e.KeyCode==Keys.ESC)
this.Close();

best regards
kiani mehdi





Similar Threads
Thread Thread Starter Forum Replies Last Post
how to disable enter key for a particular button g_vamsi_krish ASP.NET 1.0 and 1.1 Professional 1 January 19th, 2006 11:22 AM
Dynamic Insert without Submit button key value jfergy Classic ASP Databases 9 January 17th, 2006 01:49 PM
Enter key vs Click Button akibaMaila VB.NET 2002/2003 Basics 1 January 14th, 2005 12:49 PM
How do I get a form to close w/esc key (VB 6.0) BradLee31 VB How-To 3 March 23rd, 2004 08:14 PM
Button Focus and Enter Key nigel VS.NET 2002/2003 1 August 19th, 2003 07:41 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.