Click to See Complete Forum and Search --> : How to use DT_EDITCONTROL in ::DrawText


RohanG
January 25th, 2006, 02:55 AM
::DrawText(pdc->GetSafeHdc(), cstrTest.GetBuffer(20), 17, CRect(CPoint(10,
10), CSize(100, 500)), DT_EDITCONTROL);

This code compiles, but it draws the text in only one line. It is not
multilined. Is there any attributes missing for this call?

golanshahar
January 25th, 2006, 03:33 AM
look at the DT_WORDBREAK flag of DrawText(..) (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/fontext_0odw.asp)

Cheers

RohanG
January 25th, 2006, 03:51 AM
I don't want the words to be moved to the next line but teh word should be broken and moved to the next line. That is what DI_EDITCONTROL should do.

kkez
January 25th, 2006, 08:47 AM
DrawText can't modify the array for you. Words are drawn without breaks.
DT_EDITCONTOL does this:
The function does not display a partially visible last line.