471,627 Members | 1,681 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,627 software developers and data experts.

problem with textbox

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
Dec 14 '05 #1
1 1924
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!

"melanieab" wrote:
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

Dec 15 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

12 posts views Thread by Peter Proost | last post: by
4 posts views Thread by Rod Gill | last post: by
30 posts views Thread by dbuchanan | last post: by
12 posts views Thread by Joel Byrd | last post: by
2 posts views Thread by Mike Collins | last post: by
1 post views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.