Something similar to EM_LIMITTEXT but to control height?

Something similar to EM_LIMITTEXT but to control height?

Postby hua » Mon Jun 22, 2009 6:19 am

How do we control a multiline get where we have a very specific requirement on both its width and length?

For example, keying-in a default footer of 40 x 5 i.e. 40 characters wide and 5 lines in height.

Using EM_LIMITTEXT message, I could set it to 40x5 (200) but the control would stop accepting input only if user key-in more than 200 characters. If a user enter the 1st line, then keep on pressing Enter afterwards he'll easily go beyond the 5th line.

Any neat way to resolve this apart from using 5 control of single-line Get and stack them up one another?

TIA
FWH 11.08/FWH 19.12
BCC5.82/BCC7.3
xHarbour/Harbour
hua
 
Posts: 1050
Joined: Fri Oct 28, 2005 2:27 am

Re: Something similar to EM_LIMITTEXT but to control height?

Postby hua » Tue Aug 04, 2020 9:47 am

Anyone has any solution to limit the number of lines?

TIA
FWH 11.08/FWH 19.12
BCC5.82/BCC7.3
xHarbour/Harbour
hua
 
Posts: 1050
Joined: Fri Oct 28, 2005 2:27 am

Re: Something similar to EM_LIMITTEXT but to control height?

Postby nageswaragunupudi » Tue Aug 04, 2020 1:34 pm

Disable Enter key by
Code: Select all  Expand view
ON INIT oGet:WinStyle( ES_WANTRETURN, .f. )

Then the user can enter only 200 characters and can not use Enter key at all.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10308
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Something similar to EM_LIMITTEXT but to control height?

Postby hua » Wed Aug 05, 2020 3:20 am

Thank you very much Rao!
hua
 
Posts: 1050
Joined: Fri Oct 28, 2005 2:27 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 35 guests