Hi Gurus,
I need one solution
I'm using VB6, one of its Form contains a TextBox
What i need is whatever characters I type in it that
should be highlighted
ex
First when I type "a" -> "a" should be selected
second when I type "b" -> "ab" should be selected
third when I type "c" -> "abc" should be selected
fourth when I type "d" -> "abcd" should be selected
likewise it go.
ie overall characters upto the cursor end should be selected.
Help me out.
4 2018
Hi,
To Highlight Text in a Textbox, you can use this code: -
Text1.SelStart =0
-
Text1.SelLength = Len(Text1.Text)
-
Write this in Got_Focus Event.
If you write this in Change Event (as per your Requirement),
The Highlighted Text would keep on deleting with every key typed..
Not very sure, why do you have such a requirement...
Regards
Veena
Veena,
Thnks for your response.
Actually my work behind reading Barcode thru Barcode Reader into the
TextBox, The Maxlength of the TextBox is 12.
If I Input some characters manually into the TextBox Say "abc" (without quotes)
now the cursor is in 4th place from there it won't allow Barcode Reader to read.
It should start from 1st place only by erasing already existing 3 characters.
This is my situation.
Can U come out of this.
Hi,
Then, write the code (my previous post) in got_focus event, I think it would solve your problem..
Regards
Veena
Hi,
Maybe You can add this code on Change event in your textbox -
Dim ChrSet As String, chrpos As Integer, getchr As String
-
ChrSet = Text1.Text
-
If IsNumeric(ChrSet) = False Then
-
If Len(ChrSet) <> 0 Then
-
chrpos = InStr(1, ChrSet, Right(ChrSet, 1), vbTextCompare)
-
getchr = Right(ChrSet, 1)
-
Text1.SelStart = chrpos - 1
-
Text1.SelLength = Len(getchr)
-
End If
-
End If
-
This Code Will Highlight the last character, and you replaced it with the right for for you card reader!
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Mark Johnson |
last post by:
The last reply got sort of cutoff. So here again:
So for anyone interested, here's the simple regexp patterns for the
substitutions required.
The textbox control is being 'zoomed' in a popup...
|
by: VMI |
last post by:
I have two textbox controls and I want my application to automatically
highlight in the second textbox control the same amount of chars (and the
same position) that are being highlighted in the...
|
by: JM |
last post by:
Hi,
I transferred an AJAX application to the server to be used across the
Internet. On my localhost, it works great. But when I transferred it to
the server, the user control freezes for a...
|
by: scottiedog |
last post by:
Hi
How can I send a char to Textbox so that KeyPress event is called? I have a button and with a click I would like to send a char, e.g. "C", to the Textbox. But Textbox1_KeyPress is not catching...
|
by: Abraham Andres Luna |
last post by:
hello everyone,
i have an aspx page that when first loaded all the textboxes are empty. the
client side javascript will fill some of the textboxes based on what the
user selects. for some reason...
|
by: darkk |
last post by:
I was wondering how I could highlight everything in a textbox just by clicking on it.
example: textbox1 has "0" as text, I want to click and type 1, instead of having to select, then delete the 0...
|
by: > Adrian |
last post by:
Is there a way of stopping text from highlighting in textbox?
Many thanks,
Adrian.
|
by: bhappy |
last post by:
Hai,
I want to validate a textbox in clientside and im using the following code.
Regular Expression Validator
Exp: " .{250}.* " --> It means minimum length of textbox should be...
|
by: AdamOnAccess |
last post by:
Hi,
While the user is typing into a text box, I need to display the length of the string they are typing. My code is...
displayCountLabel.caption = len(me!fieldTheyAreTypingIn)
Problem is...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
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,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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$) {
}
...
|
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...
|
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...
|
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
|
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...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
| |