mardi 14 mars 2017

MFC Wrap a text for CButton checkbox if texts overruns the window width

I have a checkbox that is almost by the end of the width of a window(end of a line) so if I translate the text it overruns the window.

 CButton checkbox;
 CString str = "Cropped Value Of CheckBox";
 checkbox.create(str,WS_CHILD | WS_VISIBLE | WS_TABSTOP | BS_AUTOCHECKBOX, CRect(0,0,0,0), this, CHECK_ID);

Now if the length of str is too long that overruns the window as in screenshot:

enter image description here

It would be great if anyone could refer me to the function or any article or give me any idea to wrap this text so that if the length of the checkbox text is too long it will wrap the text in the next line and it flexes according to the size of the window. I am really new to MFC. So thank you for your help.




Aucun commentaire:

Enregistrer un commentaire