: : 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.
: I am not sure about how a barcode reader works... How does it input
: the characters? The solution to your problem probably can be handled
: by intercepting the Textbox Changed event, and setting the selected
: text to the entire contents of the textbox.
: Best Regards,
: The way I see it... Well, it's all pretty blurry
I do not know how BarCode Reader works too. May be that's why I have following questions:
1. Why do you need to highlight text in Text box before clear it?
2. Why do you need to wait for 4th(any number) character to be typed/entered before to start clear text box?
3. Why you don't place code like that
txtMyText.Text = ""
to clear text box in BarCode Reader event or before it starts to work?
Anyway there is a code example how to highligt text and clear text box
Private Sub Text1_Change()
If Len(Text1.Text) = 4 Then
Text1.SelStart = 0 ' highligt text
Text1.SelLength = 3 ' highligt text
Text1.Text = vbNullString ' clear text box