Yes, just let me shoot myself in the foot: if the vartype of this.value <> 'C', LEN(this.Value) will stir up an error.
In stead, use a memvar for the rightmost position.
This memvar has to determine what the rightmost position is.
If this.Maxlength is 0, is there a way to determine whta the...
Now that we've opened the keyboard issue, what about the <Left> and <Right> -keys ?
And another matter : if there is some text in the textbox, and the text is highlighted (=selected), then selstart = 0, so you cannot use the Backspace>. In that case, this.SelLength > 0, so now we have the...
Have you considered the number of carriage returns in the text ?
Some functions (.TextWidth including) just calculate the width of the text, without keeping track of the CR's.
That's why I intrioduced the ALINES, and the lnWrapCnt
Good luck!
Thanks for the tip about the return 0, StewartUK.
Question: when do you click outside the box, and where ?
I don't see strange behaviour in my test-environmant
In response to StewartUK: the key to this problem is :
If you have a tablename that starts with a number, the alias will NOT be 123-etcetera, but it will change into a one-letter name, for instance 'H', or something else.
The reason for this rather unexpected behaviour is, that if you would name...
SELECT balance,storeId from xyz where xyz.StoreId = cAgent into table (cFile)
cAlias = ALIAS()
... do something
USE IN (cAlias)
Or (preferably):
cFile = 'Bala' + cAgent
In that case, the alias will not change into 1 letter.
If you want an 'auto-sizing' text, I may just have the right stuff for you.
What I have used is the .Textwidth- and .Textheight-methods of the FORM (See the Help-file for more information). These functions use the FontName and FontSize of the form itself, so you will have to change the...
Note: StewartUk uses EMPTY(THIS.VALUE) in his code, but this is not what you want. If you have type 'ABCD', and then 4 times <Leftarrow>, your cursor will be at the start of the textbox. If you then type <Backspace>, your (this.value) will NOT be empty, and your textbox WILL lose focus.
Just...
The simplest solution that I have found goes as follows:
In the Valid of the textbox, put the following commands:
** avoid message 'Invalid Input'
** tip : store current NOTIFY-setting in a Form-property
SET NOTIFY OFF
** selstart is the cursor-position
IF this.selstart < 1 AND LASTKEY() = 127...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.