setfocus problem (1 Viewer)

FireStrike

Registered User.
Local time
Today, 16:39
Joined
Jul 14, 2006
Messages
69
I have a form that has a group of text boxes. The top one is a customer box and the rest is unimportant. What I need to do is to fill in the unimportant tesxt boxes on the change event of the customer box. To do this, I have to setfocus to each box individually update their information, and then proceed to the next. This all works as it should. But once I get to the last one, I give focus back to the customer box. Here is the problem. When the customer box get focus, it highlights the data that is in it, and if you type, it overwrites what was in there.

for example, when I type a "d" into the customer box, I get as results

dragon
dog

then when I type an "r" I want dragon, but it overwrites the "d" and gives me

rufus

All of my textboxes are unbound. Does anyone know of a work around for this?
 

Bodisathva

Registered User.
Local time
Today, 16:39
Joined
Oct 4, 2005
Messages
1,274
it's a default action for a text box (when it receives the focus it highlights everything). You can bother with the whole, setfocus stuff, which is caused when you use
Code:
txtBoxName.Text = "blah, blah"
or you can simply use
Code:
txtBoxName = "blah, blah"
you don't need to shift the focus and your problem goes away.
 

FireStrike

Registered User.
Local time
Today, 16:39
Joined
Jul 14, 2006
Messages
69
awesome that worked. Thank you very much
 

Users who are viewing this thread

Top Bottom