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

Pressing [ENTER] in a textbox

Hi,

I've got a number of textbox's on a windows form in VC++ .NET.
I've got it so that when the user presses [ENTER] whilst in a textbox then
it goes to the next tabstop. This works fine however Windows play the ding
sound as if a invalid key has been pressed. Is there a way to stop this
happening.

Thanks in advance

Paul.
Jul 21 '05 #1
1 1445
Hi,

You need to add a handler to the KeyPress event to 'handle' the event caused
by an Enter keypress (as in the following, shamelessly pinched from another
post today - piece of cake to convert it to C++).

Steve

private void textBox2_KeyPress(object sender,
System.Windows.Forms.KeyPressEventArgs e) {
if (e.KeyChar == 'r') e.Handled = true; // You can also test
against char(13)
}
"Paul Steele" <p.******@vr-centre.com> wrote in message
news:eA**************@TK2MSFTNGP11.phx.gbl...
Hi,

I've got a number of textbox's on a windows form in VC++ .NET.
I've got it so that when the user presses [ENTER] whilst in a textbox then
it goes to the next tabstop. This works fine however Windows play the ding
sound as if a invalid key has been pressed. Is there a way to stop this
happening.

Thanks in advance

Paul.

Jul 21 '05 #2

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

Similar topics

2
by: T.E. | last post by:
Hi all, I'm a newbie in php. I encounter a problem with php form that has only one textfield. If I click on the submit button, the form works fine. However, when I press 'enter', the form...
1
by: ShoCkwave | last post by:
I have a textbox. If I write something in it and then press enter I want a specific method to be executed. How can I add this event to textBox? Thanks. Posted Via Usenet.com Premium Usenet...
10
by: mg | last post by:
I want to enter characters in a TextBox in a WebForm, press a Button in the WebForm, and read the characters that were typed into the TextBox from within the Button_Click event handler. The main...
4
by: Jerry | last post by:
Hello I have some textboxes (input type=Text) in a Form. In some Forms if I Press Enter while I am in the Textbox It causes a Submit. The input type is text not submit. It's obsure that the...
2
by: Cindy | last post by:
Hi all you smarties out there, I'm having a little conundrum with my asp.net page Scenario: I have a form (asp.net) with no code behind (as yet). I have placed a javascript function on a...
2
by: Fernando Lopes | last post by:
Hi. I one usercontrol, i have a zipcode textbox . I need to, when user press ENTER, I call a code-behind method, to check this zipcode on database and, depending the return of this check,...
3
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...
4
by: nkoier | last post by:
Hi, I've been going crazy trying to figure out what's wrong with our Asp.Net 2.0 intranet site. At the very top of our main page I provide a TextBox and a Button for submitting Google searches....
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.