Login
`
Templates, Tools and Utilities
|
||
Add a comment to an Icetips ArticlePlease add your comments to this article.
Please note that you must provide both a name and a valid email address in order
for us to publish your comment. Comments are moderated and are not visible until they have been approved. Spam is never approved!
Back to article list Search Articles Add Comment Printer friendly Direct link Par2: Limiting number of characters entered in a field 2006-12-15 -- Larry Sand If you want to limit the text box to n characters you can send it the Edit
Message: EM_LIMITTEXT Like this:
SendMessage(hWndText, EM_LIMITTEXT, nTextLimit, 0)
hWndText is the handle to the text box, ?textbox{Prop:Handle}
EM_LIMITTEXT EQUATE(00C5h)
nTextLimit is the number of characters.
This does not require that you subclass the text box.
If you want to know the number of characters as they're typed you can
subclass the control and watch for the Edit Notification message EN_CHANGE.
Edit notification messages are sent in a WM_COMMAND message.
Today is November 21, 2024, 6:46 am This article has been viewed 35231 times.
|
|