From: John Smith on 16 Jul 2010 05:14 I have a multiline edit-control. When a user type more than 40 characters on the the line should word wrap to the next line. I tried the example at http://support.microsoft.com/kb/109551 but I could not figure how to make it work in my case. When uses is finished and closes the control my program send the contents to a array structure that has max 40 characters per line.
From: Paul N on 16 Jul 2010 06:56 On 16 July, 10:14, John Smith <do_not_...(a)invalid.address.com> wrote: > I have a multiline edit-control. When a user type more than 40 characters on the > the line should word wrap to the next line. > > I tried the example athttp://support.microsoft.com/kb/109551but I could not > figure how to make it work in my case. > > When uses is finished and closes the control my program send the contents to a > array structure that has max 40 characters per line. That example uses a custom wordbreak function, which may be more complicated than what you need. Certainly I've managed without it. If you have a multiline edit box, and you don't set the ES_AUTOHSCROLL style, then words should wrap onto the next line as you type them. However, when you then read the text, all the wrapping disappears. The secret is, after the user has finished editing the text but before the program reads it, to send a EM_FMTLINES message. See http://msdn.microsoft.com/en-us/library/bb761570(VS.85).aspx Hope this helps. If it doesn't, please come back with a bit more detail of how it doesn't work. Paul.
|
Pages: 1 Prev: Problem with time-conversion Next: Book problems and solution for windows 7 |