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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Editbox Cursor Position

Status
Not open for further replies.

hjohnson

Programmer
Aug 1, 2001
90
US
I have a editbox on a form whose controlsource is a memo field. The memo field is contantly being updated as to status of the process and therefore so is the editbox. The position of the cursor is alway at the first line in the editbox- Is there any way to force it be at the end so the user doesn't have to keep scrolling down to read the last entries?

A million thanks in advance

HJ
 
In this instance, edtNotes is your editbox and curNotes.Notes is the bound field. At the point you refresh or whereever add:

.edtNotes.SELSTART = LEN(ALLTRIM(curNotes.Notes))
.edtNotes.SETFOCUS()
"I love work. I can sit and stare at it for hours..."
 
HI

In the EditBox.GotFocusEvent put the code..

KEYBOARD "{CTRL+END}"

This will take care of positioning at the end. :)
ramani :)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com
 
Hi Ramani

The {CTRL+END} does put the cursor at the end but if the editbox is scrollable it doesn't scroll to the end. "I love work. I can sit and stare at it for hours..."
 
Sorry Ramani, it does, my mistake! "I love work. I can sit and stare at it for hours..."
 
Thanks, This works great as long as the editbox as the focus, as soon as it's lost, the cursor goes back to the top- I need to have the focus set to another control- Would I be better off using a different type of control?

HJ
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top