Re: field size
- Posted by irvm at ellijay.com Jul 26, 2001
- 332 views
On Thursday 26 July 2001 13:31, gwalters at sc.rr.com wrote: > Can someone tell me how to control the number of chars that can be entered > in a field? Now the entered items continue to scroll. (i.e. for the state i > would only allow 2chars to be entered) > > ...george > Here's a clip from Brian Broker in the archives: On Wed, 6 Sep 2000 18:10:41 +0200, bobspringett wrote: >Could someone please advise me how to limit the number of characters entered in a one line EDIT CONTROL. >Regards >Bob Use SendMessage( ControlID, EM_LIMITTEXT, limit_number, NULL ) where 'limit_number' is your limit. Example: include win32lib.ew constant Win = create( Window, "limit", 0, Default, Default, 200, 100, 0 ), Box = create( EditText, "", Win, 10, 10, 180, 20, 0 ) procedure onOpen_Win() atom nil -- limit of 10 characters in Box -- nil = sendMessage( Box, EM_LIMITTEXT, 10, NULL ) end procedure onOpen[Win] = routine_id( "onOpen_Win" ) WinMain( Win, Normal ) -- Brian