If I have a textbox with maxlength 80, so I can print 80 characters to printer.
80 W`s go off the print page, where 80 I`s are only half the width of the paper
What I need is to be able to limit the length of the text box to the 8 inch paper size not number of characters.
Is there a way to stop entry at the width of the textbox, this would stop the problem, as I could set the character length by textbox width.
Thanks in advance.
Set length of textbox
Moderator: Rathinagiri
Set length of textbox
All The Best,
Franco
Canada
Franco
Canada
- AUGE_OHR
- Posts: 2061
- Joined: Sun Aug 25, 2019 3:12 pm
- DBs Used: DBF, PostgreSQL, MySQL, SQLite
- Location: Hamburg, Germany
Re: Set length of textbox
hi,
you can set TEXTLIMIT of TEXTBOX with EM_SETLIMITTEXT
you can "calculate" length of String with
Tip : use "WWWWWWWWWW" and FONT, which you want to use, to "calculate" Limit
you can set TEXTLIMIT of TEXTBOX with EM_SETLIMITTEXT
Code: Select all
hWnd := GetControlHandle( ControlName, ParentForm )
SendMessage( hWnd, EM_SETLIMITTEXT, nLimit, 0 )
Code: Select all
nLength := GetProperty ( FormName, ControlName, "GetTextLength" )
have fun
Jimmy
Jimmy
Re: Set length of textbox
Thanks Jimmy, I can not get to work but I already use when setting up text box which works. I thought I could maybe set when printing.
Code: Select all
DEFINE TEXTBOX TEXT_1
//OTHER SETTINGS
MAXLENTH nLength
CASECONVERT UPPER
All The Best,
Franco
Canada
Franco
Canada