problem with textbox

G

Guest

Hi again,
I have a textbox where the text is longer than the textbox width. When I
type something in there or even do any single keystroke (other than tab, up,
down, or enter) and then leave, the beginning of the string shows, and focus
goes on to the next box. But if I just tab through or want to go straight to
the next textbox, the beginning of the string is cut off, leaving the end of
the string visible.
More info that may/may not be helpful:
When the textbox is initially entered, I highlight the entire string using
selectionstart = 0, selectionlength = textbox.text.length, textbox.focus;.
In my FocusLeave event, I do use textbox.SelectionStart = 0;, but it only
works if there's that other kind of keystroke (like "a" or left arrow).
Any suggestions???
Thanks again,
Mel
 
G

Guest

Hi Mel,

I may be a little confused with your exact problem, I'm not sure what you
mean by the focus leave event only working when there is a keystroke such as
left arrow or "a". Does this mean when you do something like enter a longer
string than the width, and then tab away from the textbox it is not returning
to the beginning of the string? What I did was implement the Leave event and
had it set the selectionstart to 0. This did work for me in a situation
where I tabbed away from the textbox or selected another control with the
mouse. Hope this helps!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top