How to limit the text entered into an edit/richedit control?

Call CEdit::SetLimitText or send EM_LIMITTEXT windows message to an edit control. There are some caveats associated with this functionality… This limitation does not affect the amount of text entered via a call to SetWindowText, or WM_SETTEXT. This limitation does not hold true for paste operation. This limitation does not affect text already entered into an […]
Continue reading…