Comments

: Hi Genius: VB6 Form has 1 Textbox: if I type "abc" (without Quotes) in the Texbox : the whole word "abc" (without Quotes) should be: highlighted & focus should be in Textbox itself.: :

As in:

[code]Textbox Type char a[color=blue]a[/color] b[color=Blue]ab[/color] c[/code]Where the left column in how the textbox looks before typing the character in the right column.So, as you type the character gets added to the selected part. Is that what you want?

It would involve capturing a couple of events from the textbox that would normally do something to the selected index. Also, when the user types c and ab are selected, then normally ab will be deleted. This you're going to have to handle as well in the keypress event.

Thnks for your response.Actually my work behind reading Barcode thru Barcode Reader into theTextBox, 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.

: 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.

: : 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,: Richard: : 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 [code] txtMyText.Text = "" [color=Green]'or[/color] txtMyText.Text =vbNullString [/code] to clear text box in BarCode Reader event or before it starts to work?