473,511 Members | 17,164 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Button behaviour

Can I configure a button so that when I press "Enter" key in a text box to
trigger the button onclick event?
Aug 10 '06 #1
2 1202
Change the containing form's .AcceptButton to the button; this should
then work (for single line boxes).

If this isn't possible (e.g. a UserControl or a multi-line box) you may
need to handle keypress events instead.

Marc

Aug 10 '06 #2
Hello Alan,

In the button Key_Down handler check that KeyEventArgs.KeyCode == Keys.Enter
and call onclick handler
ATCan I configure a button so that when I press "Enter" key in a text
ATbox to trigger the button onclick event?
AT>
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
Aug 10 '06 #3

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

Similar topics

1
1579
by: jim gigurtsis | last post by:
I am trying to get the BACK button to re-post the request to the server for IE 5+. I have used, Response.ExpiresAbsolute = #1/1/1980# Response.AddHeader "cache-control", "no_store, must-...
1
1691
by: Karuppasamy | last post by:
Hi In Windows Application (C#), on RightMouse Button click in a Textbox, a Popup menu with Cut / Copy / Paste is appearing. How to disable this behaviour. I dont want to allow the user to copy...
1
1281
by: Christoph | last post by:
Hi I have different images which i use to simulate a button behaviour. This looks as follows: if (document.images) { toc1over = new Image(31,54); toc1over.src = "b go focus.bmp"; toc1down=...
1
10799
by: Andy Rose | last post by:
..Hi all, I want to catch an 'enter' keypress event on a web form and submit the form as if a button had been clicked rather than the default post back behaviour. I know the following javascript...
14
2606
by: clintonG | last post by:
This is an appeal for peer support sent to Microsoft as will be noted in closing. The Login control does not include a Cancel button. The only option is to convert the Login control to a...
3
1533
by: Vikram | last post by:
I have a button and a text box. when i press enter on text box i want button click at servide side shoiul fire. I thin its a default behaviour but its not happening. Page is posted back but button...
1
2186
by: nileshsoni21 | last post by:
I have come across a strange behaviour in ASP or rather it could be a HTML or Browser Issue. The browser here is IE. The requirement is to re-load the page whenever user click back button of the...
3
5391
by: Patrick [MSFT] | last post by:
Let me preface this with the goal I'm trying to achieve is mimic a feature of another language (Dexterity used by Microsoft Dynamics) and so while a filling a drop down list is a workable solution...
0
1155
by: BarryM | last post by:
Hi, I have web form with 2 submit buttons. One has the PostBackUrl property set to another page, and the other has nothing and falls through to the default behaviour of posting back to it's...
7
9061
by: Marcolino | last post by:
Hi all, I need to add a custom button to title bar on a form in addition of a standard button. (Minimize/Maximize, close etc.) I need also to handle OnClick event of this button. I looked around...
0
7245
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
7356
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
7427
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...
1
7085
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
7512
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
5671
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,...
0
3227
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1577
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
449
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.