473,385 Members | 2,269 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.

highlight text field or masked field on got focus

274 100+
Hi Everyone
I switch between various fields on the form by using ENTER and TAB keys. I want to highlight existing value of a text fields when I get it focus. When we use combo, on getting focused on it it highlight the whole value present in it. Can I do this with text field and masked fields too?
Thanks in advance.
Nov 8 '07 #1
2 3532
QVeen72
1,445 Expert 1GB
Hi,

Write this in GotFocus event of that control:

Expand|Select|Wrap|Line Numbers
  1. Private Sub MaskEdBox1_GotFocus()
  2.     MaskEdBox1.SelStart = 0
  3.     MaskEdBox1.SelLength = Len(MaskEdBox1)
  4. End Sub
  5.  
  6. Private Sub Text1_GotFocus()
  7.     Text1.SelStart = 0
  8.     Text1.SelLength = Len(Text1)
  9. End Sub
  10.  
  11.  
Regards
Veena
Nov 8 '07 #2
creative1
274 100+
Thanks Veena
So nice of you!
It worked. thankyou very much.
Farhana
Nov 8 '07 #3

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

Similar topics

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...
1
by: Per Magnus L?vold | last post by:
Hi! I'm working on a JSP application, and wish to define a text-field so that it becomes marked (highligted) when it obtains focus. I've tried giving the text-field a value when it obtains...
5
by: nboutelier | last post by:
Scenario: you enter "foo bar" into a text field... Is it possible through javascript to select/highlight just "foo"? formObject.select() selects all. I need to select only part of the string....
3
by: JingleBEV | last post by:
Hi all, I have a masked text control that would return a date in string format via the mask property like: "9/23/2004" and i have a calendar control that would pop up when I click a command...
2
by: parm | last post by:
How do I highlight text in my first (tabindex = 1) asp control (eg: textbox) on the webform on page load. If I try to set focus using javascript then I get script error "Cannot move focus to...
5
by: marfi95 | last post by:
I'm very confused. I'm trying to automatically select the text when my textbox gets the focus. This is typically when the user has clicked the mouse in the field. This is the code I have in...
1
by: tranky | last post by:
Hola boys, i've a question for you! It's possible to highlight some text inside a textarea? (not all text, but a portion!) For example, i've this text inside a textarea. INSERISCI TESTO i...
3
by: dmbuso | last post by:
I have a money field defined in a SQL Server 05 database with a value of 49.50. Also, it displays in SQL Server as 49.5000. I have a form in VB.NET 2005 and I'm using the new MaskedTextBox control...
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: 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
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
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?
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,...

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.