Setting Rich edit control's width dynamically to fit entire text
-
Hi I want to change WIDTH of my rich edit control as user types text in it, so that it displays the entire text instead of scrolling text horizontally. My rich edit is a multiline control I have used
EN_REQUESTRESIZE
notification msg but this works only for adjusting height of control andEN_REQUESTRESIZE
is working perfectly in case of height, i.e I use to change the control height when i get this msg to show all lines of text. kindly help!!!! its urgent Muhammad Azam -
Hi I want to change WIDTH of my rich edit control as user types text in it, so that it displays the entire text instead of scrolling text horizontally. My rich edit is a multiline control I have used
EN_REQUESTRESIZE
notification msg but this works only for adjusting height of control andEN_REQUESTRESIZE
is working perfectly in case of height, i.e I use to change the control height when i get this msg to show all lines of text. kindly help!!!! its urgent Muhammad AzamIf your problem is the scroll-bars that unexpectedly appear even after you resized the rich edit control during
ENM_REQUESTRESIZE
, then please note that the new control size probably should include the width of the control’s borders. Try to specify a little bigger size. Otherwise, what exactly occurs when you type a long line of text? -
If your problem is the scroll-bars that unexpectedly appear even after you resized the rich edit control during
ENM_REQUESTRESIZE
, then please note that the new control size probably should include the width of the control’s borders. Try to specify a little bigger size. Otherwise, what exactly occurs when you type a long line of text?Thanks Viorel, No the problem is not with scroll-bars the problem is that when user types some text in the control and the text reaches right border of control than how much should i increase width of my edit control (based on current font size, face name etc..) so that the next character typed, is visible and no scroll bar or word-wrapping should occur. And when the control's width reaches right border of dialog than word wrapping should occur. thanks Muhammad Azam