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

Highlighting a text box for data entry..

6
Hi folks,

In learning VB I've designed a little program which requires user input of time hh:mm. The field is selected when the form opens (due to tab order) but the cursor bar is to the left of the default entry (00:00). How can I present the text box in such a way as to allow immediate input by the user? Currently they must grab their mouse and double click inside the (already active) box in order to fully select the contents for replacement.

Secondly, how can I force the execution of a command button upon the user pressing enter after the original data entry?

I realize these may be basic questions (I'm basically a beginner). Sadly, I've yet to learn enough of the "lexicon" of VB to ask intelligent questions or find references in the documentation.

Any light you can shine on this would be appreciated,

Thanks!
Sep 17 '06 #1
2 2343
Rahna
12
I'm not sure whether this is the right way to do this, but the code given below will help you to select the text.

Text1.SelStart = 0
Text1.SelLength = Len(Text1.Text)

And to click a command button by pressing the 'Enter' key, set the 'Default' property of the button to 'True'.
Sep 18 '06 #2
CRSI
6
I'm not sure whether this is the right way to do this, but the code given below will help you to select the text.

Text1.SelStart = 0
Text1.SelLength = Len(Text1.Text)

And to click a command button by pressing the 'Enter' key, set the 'Default' property of the button to 'True'.
The tip on setting the default propoerty of the command button worked great.
However, I still can't seem to get the Text box in which I'm asking for user input to present a select all condition.

I'm asking the user to enter the time stamped on a ticket. Currently in the "text" property of the text box I've provided 00:00 and thinking it would help I selected "data format" Time (17:55 for example).

Now I'm thinking that I'll have to approach it another way, perhaps setting the SelStart and SelLength when the focus is on that field.

Then there is the whole issue of error checking to prevent the user from putting in an "illegal" time like 99:67. When that happens now get a "type mismatch" error message that pops up. I'll get there eventually.

Thanks for your willingness to chime in and give me a boost!

Regards
Sep 18 '06 #3

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

Similar topics

4
by: Bob hotmail.com> | last post by:
Everyone I have been spending weeks looking on the web for a good tutorial on how to use regular expressions and other methods to satisfy my craving for learning how to do FAST c-style syntax...
7
by: JohnSmith90 | last post by:
I want to highlight the entire cell data for all rows of a particular column in a data grid. I do not want to fill the back ground color of the cell. How to do that in a data grid? <span...
6
by: pallabs | last post by:
I'm new to asp.net and is having problems doing the following: 1. The tab sequence in a asp form is not working properly. The page is a login form and tabindex is set to 0 for username, 1 for...
14
by: Joe | last post by:
Hello All: I am trying to dynamically populate a web page with literal content and controls (textboxes and checkboxes (and eventually two buttons - the buttons do not appear in the code yet). I...
4
by: Patrick Porter | last post by:
Arrrgh! I have tried everything (ok, not EVERYTHING) but i cant get solve the problem of getting syntax highlighting in a rich textbox. in the code below, im attempting to highlight all of the...
1
by: semi_evil | last post by:
I'm trying to achieve the following: start form entry user enters form data and submits ($form_data) preg_match_all data for $pattern, store matches in $match_arr if one or more matches...
14
by: > Adrian | last post by:
Is there a way of stopping text from highlighting in textbox? Many thanks, Adrian.
1
by: alamodgal | last post by:
hiiiiiii I have a problem in highlighting searching keyword.Actually im using this function for searching Public Function HighLight(ByVal Keyword As String, ByVal ContentFor As String) Dim...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
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.