Cursor Position at end of textbox

craigachan

Registered User.
Local time
Yesterday, 16:44
Joined
Nov 9, 2007
Messages
285
I need help figuring this one out.
I have a memo field that shows about 700 characters on my form but can old a lot of text sometimes. The memo field is populated with text that comes from stock phrases from a listbox click. When I open the form, or add text by the stock phrases from the listbox, I want to see the last 5-6 lines or the last 300-400 characters. This is okay as long as the field holds less than 700 characters.

The problem that I have is when the memo field has greater than 800 characters. I want to be able to see not only the phrases that I'm adding, but also the 4-5 lines above. I've toyed around with SelStart and SelLength, but just can't seem to get the code right. I can put the cursor at the end of the text, but sometimes the box scrolls so that only the last line of text is visible until I scroll it up. Basically, I want to add text and see the text that I'm adding by controlling how much text is showing in the memo field, especially when there is > than 700 characters already in the memo field.

Any Ideas would be appreciated.
 
I doubt you'll find a satisfactory solution to cover exactly what you want. But how about this - when you put your cursor in the text box, the text box resizes to give you almost the full screen and when you exit it goes back to the normal size. Or, when you click in it a form pops up that is much bigger and has the space to view it better and then you close the form and it updates the text box with the text in that form.

Just a couple of alternative ways (both of which I've used in a live setting before).
 
Thanks for your reply. It's nice to have you experts around to help us amateurs see what is possible.

I'm just curious how to make the field size get bigger. What property/code would I use. I'm thinking I need to use this method rather than another form, so that I can still use my listboxes to populate the memo field.

Thanks again for thinking out of the box.
 
Check out this sample and what happens when you move in and out of the memo text box.
 

Attachments

Also, you can click in the memo field the press Shift+F2 to Zoom the memo field
 
Also, you can click in the memo field the press Shift+F2 to Zoom the memo field

However, with the ZOOM I don't believe the cursor goes to the end. But, you can't get past 32,767 characters to get to the end of the memo field via code (at least that I've found) anyway because anything over that causes an overflow error using the SelStart property.
 
Thanks for your help Bob, I have some good ideas now. Great suggestion.
 

Users who are viewing this thread

Back
Top Bottom