Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can scroll string in data entry time?

Status
Not open for further replies.

farzad321

Programmer
Sep 14, 2019
53
0
6
FR
Hi to every one
I have a field desc char (120). because of my form width , i just have 50 character width for text box. now how can set it that when user type into desc , when 50 char is fulled, when type the rest of data entry, the text box scrolled and in any time user can see end of typed data?
This is my question in left to right languages and also right to left.
Do you think i must write a function for it or we can find better solution ?
Thank you
 
when you set controlsource of a plain normal textbox to table.desc this is default behaviour.

For left-to-right what you type scrolls previous text to the left, you see the rightmost portion of the text.
When you set Textbox.RightToLeft to .T. this should work the same. The helptext on the property says its function is restricted to Middle Eastern versions of Windows.
help said:
RightToLeft is disregarded unless you are running a Middle Eastern version of Microsoft Windows

If you don't set a controlsource to a field, the textbox will stop or jump to position 1 once you entered more than is visible, but that can also be tamed by setting the MaxLength property to 120.

I have no idea whether VFPs dependency on detecting a Widows version with Right-To-Left aligned text is still valid. Since Vista Windows has the MUI (multilanguage user interface), I have no idea whether and how I could use it to display right-to-left. For me the helptext is correct, ie when I set RightToLeft .T. I still enter text left to right.

If all else fails you can push the text cursor to the visible textbox area by setting Textbox.Selstart. If you set to Len(textbox.value) the cursor will be at the end of the text and visible, which includes the scrolling to the left (or right), but as far as I see I didn't need to set this. Are you maybe using a textbox class that lets data entry work different by perhaps setting SelStart to 0 after each interactive or programmatic change?

Chriss
 
Chris has given you a good answer.

But there is another option you might consider. Instead of using a textbox, you could consider using an editbox, which is generally a good solution for long pieces of text. From the user's point of view, an editbox is usually easier to work with, as they can see the entire text without horizontal scrolling.

An editbox might not be the best solution in this particular case, but it is worth considering.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Hi Sir

Thank you to Chris and Mike that always help people like me. and also sorry for delay in answer to this topic.

I will write a sample with this two way for test as you said, but I think if I use a editbox , I have some less problem because of my form width. I will write you a result.

Thank you again
FARZAD
[thumbsup2]
 
Is the display width small too? Or only the form width?
You could also simply work with a WAIT WINDOW or the status bar text to show the full text. Or a label with textbox width and wordwrap would grow with the text as needed.

Chriss
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top