Re: Edit Control

new topic     » goto parent     » topic index » view thread      » older message » newer message

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

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu