Page 1 of 1

Text Entry to Top

PostPosted: Thu Jul 01, 2010 8:49 am
by datadon
One thing that has bugged me forever and it seems I have found work arounds before, is that when loading a text entry box with data, it will scroll down to the bottom of the data.

I would LOVE to see an option in the text box that would take it back to the top of the data.

Or perhaps there is an easy solution that I have not known about or forgotten.


PostPosted: Thu Jul 01, 2010 9:48 am
by Gaev

What do you mean by loading a text entry box with data ? ... is the user doing a paste from the Clipboard (Ctrl+V) ? ... or is there are SetVar command doing it ?

If it is the latter, do something like ...
Code: Select all
SetVar "[textEntry2]" "abcd"
SendKeys "" "{Home}"
... depending on your circumstances, you may need to add a FocusObject command before the SendKeys.

You can also append a (tiny) button to the right of the TextEntry Box which would do the FocusObject/SendKeys commands when clicked.

PostPosted: Thu Jul 01, 2010 10:42 am
by datadon
Ok, yes that was the way I did it in the past probably due to your reply then. This getting old is for the birds.

Actually it is just a textentry field that is disabled and is used to display a field in the database. I just added your sendkeys code to the on text change and it seems to work well. I will try on the others also.

However, it still would be a nice feature if a check box could be added to do this. I know lazy lazy man. Never add a feature that can be coded in or out.

Hey I am into lazy when I can't remember the code.

Thanks again and again Gaev.

PostPosted: Thu Jul 01, 2010 10:48 am
by datadon
I spoke a little too soon. That placement of the code does not work on fields that need to be edited. What would be the best placement for the code when the field needs to be edited? On record change? How would that work?

PostPosted: Thu Jul 01, 2010 1:14 pm
by Gaev

I don't think it is a good idea to place the SendKeys command in the Text Change section of the TextEntry Box.

In the "subroutine" specified within the dbpOpenTable command ... whenever you do a SetVar command to transfer the contents of a field to the TextEntry Box, immediately follow it up with a FocusObject and a Sendkeys command.

Alternately, you could look for the value of a variable in the Text Change section of the TextEntry Box ...
Code: Select all
If "[SetCursor]" "=" "HomePosition"
   SendKeys "" "{Home}"
... and control the value of [SetCursor] from within the Text Change section.

Note that the Text Change section is triggered when I do a SetVar command that populates the value of the TexEntry Box with the contents of another variable; have not not verified if it is triggered when updating it with a database field from within the database subroutine section.