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

Text Box Enter - vb6

6
Hi, I have a text box in a form which I want to work with Enter key meaning when we type a text and hit the Enter key it works.
thanks
Mar 2 '08 #1
2 1477
xLin
3
Well, under the Textbox Key_Press, add this.
Expand|Select|Wrap|Line Numbers
  1. If KeyAscii = 13 Then
  2. KeyAscii = 0 'Prevents the beep
  3. 'Actions here
  4. End If
Done.
Mar 2 '08 #2
Killer42
8,435 Expert 8TB
One technique I've used in the past is to hide a command button somewhere (or leave it visible, so the mouse can also be used) and set its .Default property to True. That way, as far as I can recall, it should trigger when Enter is pressed. However, I seem to also remember that it still beeps, so you may need to use xLin's code to suppress that.

Note, it might be better to use the form's KeyPress or KeyDown event, rather than the textbox's, but to do that you need to set the form's KeyPreview property to True.

(Note: by "hide" I mean to obscure it behind something or off the edge of the form. If you actually set it to not visible, I'm pretty sure it won't respond to any user events.)
Mar 3 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: Stephen Saunders | last post by:
Hey Folks, This one currently has me stumped. I have to check for the existence of a carriage return (Enter key, hex 0D) in text data. First I tried: 'Check comment to not contain the CR...
3
by: Mark | last post by:
Hi, Im trying to validate a form, all the validating works apart from one field. This particular field must consist of the first 2 characters as letters, & the following 5 as numbers. And if it...
9
by: Megan | last post by:
Hi- I'm creating a database of music bands with their cds and songs. I'm trying to program an SQL statement so that I can enter a string of text in a textbox, press the 'Enter' key, and have...
0
by: Lalit Bhatia | last post by:
I have a problem while using Enter key in text box. when user presses enter in the text box information of customer is loaded. and I have a clear button that clears all the controls on the form....
0
by: Greg | last post by:
I am working on an application that requires working with numbers in scientific notation. I am using SqlServer as the database and I have created strongly typed data adapters and datasets. The...
5
by: grinder | last post by:
first off, i am an extreme newbie to C. i am an undergrad research assistant and i have been shifted to a project that involves building a fairly involved c program. The part that i am stuck on now...
3
by: acecraig100 | last post by:
I am fairly new to Javascript. I have a form that users fill out to enter an animal to exhibit at a fair. Because we have no way of knowing, how many animals a user may enter, I created a table...
3
by: Rupe | last post by:
Because this is a form with a single text field, I require submition when ENTER OR TAB is pressed in the text box). However since their is only one field I can't use tab. Nor for some reason can I...
1
by: stewdizzle | last post by:
I have a from with three radio buttons (same group) and three text boxes. The radio buttons give the user a choice of uploading one, two, or three images. Currently, I have the text boxes load as...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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
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
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,...

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.