473,395 Members | 1,996 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.

C# : How to handle the ENTER key

i had designed a win app(an address book)

when the user wants to enter the contact he will type in all the
details and "HE SHOULD CLICK ON THE ADDENTRY BUTTON PROVIDED"

i want to simplify this task for the user by allowing the data to bw
added in database when "HE PRESSED ENTER KEY AFTER ENTERING THE
DETAILS"

Jun 7 '07 #1
4 8597

Hi, KenDev

Easy way is to create a default button and make a form to accept the button
as defult action by enter.

WBR, Alex Meleta
Blog:: devkids.blogspot.com

si had designed a win app(an address book)
s>
swhen the user wants to enter the contact he will type in all the
sdetails and "HE SHOULD CLICK ON THE ADDENTRY BUTTON PROVIDED"
s>
si want to simplify this task for the user by allowing the data to bw
sadded in database when "HE PRESSED ENTER KEY AFTER ENTERING THE
sDETAILS"
s>
Jun 7 '07 #2
On Jun 7, 7:44 pm, Alex Meleta <amel...@gmail.comwrote:
Hi, KenDev

Easy way is to create a default button and make a form to accept the button
as defult action by enter.

WBR, Alex Meleta
Blog:: devkids.blogspot.com

si had designed a win app(an address book)
s>
swhen the user wants to enter the contact he will type in all the
sdetails and "HE SHOULD CLICK ON THE ADDENTRY BUTTON PROVIDED"
s>
si want to simplify this task for the user by allowing the data to bw
sadded in database when "HE PRESSED ENTER KEY AFTER ENTERING THE
sDETAILS"
s>
If you want to avoid the button, trap the key in event for the
textbox(or any input box) that you are using. KeyDown event would do I
think.

Jun 7 '07 #3
that's good idea but how can we create a default button and make the
form accept the buuton on pressing the enter key..
Hi, KenDev

Easy way is to create a default button and make a form to accept the button
as defult action by enter.

WBR, Alex Meleta
Blog:: devkids.blogspot.com
Jun 8 '07 #4

You can make button default by setting the ".AcceptButton" property of the
form to the instance of button.

Alex
http://devkids.blogspot.com
that's good idea but how can we create a default button and make the
form accept the buuton on pressing the enter key..
>Hi, KenDev

Easy way is to create a default button and make a form to accept the
button as defult action by enter.

WBR, Alex Meleta
Blog:: devkids.blogspot.com

Jun 8 '07 #5

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

Similar topics

3
by: Mike L | last post by:
For a Data Grid in a Win Form, when the user selects a row and then presses the Enter key, how do I capture that the user pressed the enter key?
1
by: Stephen J. Shephard | last post by:
Hi there, I know this is probably a 101-type question, and I've dealt with it using client script blocks before, but I'm curious about what the best way to handle the enter key is.. (i.e., to...
6
by: Mark | last post by:
Hello, I'm trying to handle HttpRequestValidationException. If a hacker enters certain values into a textbox, like "<script>", it will trigger this error. I understand why .Net has this, but I...
15
by: Adam J. Schaff | last post by:
I have noticed that if a user closes a form via pressing return (either while the OK button has focus or if AcceptButton is set to OK for the form) then the "ENTER" keypress event fires ON THE...
2
by: matthewr | last post by:
In Internet Explorer, for example, when you hit return in the address bar, the Go button is pressed. In my program, I have a toolstrip with a textbox and button. How do I ensure the button is...
3
by: John Dalberg | last post by:
I have an app that keeps popping up a windows with a 'Yes' or 'OK' button on it. I am trying to write a little app that automates hitting the enter key so I don't have to do it myself. I used...
3
by: Zytan | last post by:
I can handle DoubleClick on a ListBox to respond, not when the selection changes, but when you double click one to invoke an action. This is the same as using the keys to move the selection, then...
2
by: sravan_reddy001 | last post by:
i had designed a win app(an address book) when the user wants to enter the contact he will type in all the details and "HE SHOULD CLICK ON THE ADDENTRY BUTTON PROVIDED" i want to simplify this...
1
by: ahmadnadeem | last post by:
Sir i want that when i press four times the enter key the cursor should come to the new line withen rich textbox in c# language.
1
by: daonho | last post by:
I tried to use javascript to trigger up the button click function when user press enter key from the textbox. This function work fine with a single button click such has login page. However, if the...
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: 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
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,...
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.