Wordwrapping in Win32 API text boxes
Ok, No matter what I try I just cannot get this to work, I have spent large amounts of time flicking through MSDN and mucking around with the code just to fail time and time again.
If anyone can help me out with this problem It would make me so overjoyed and happy and overjoyed and happy (you get the idea)...
-Big AL
Use these when creating your edit box:
ES_AUTOVSCROLL, ES_MULTILINE, WS_VSCROLL, ES_WANTRETURN
ES_AUTOVSCROLL, ES_MULTILINE, WS_VSCROLL, ES_WANTRETURN
You can set them on/off with the SetWindowLong function. Details on how to use it is on the MSDN.
Ok, I have used
This does NOT work, and I can''t see why...
Any help?
Big Al
unsigned long WordwrapStyle = WS_CHILD / WS_VSCROLL / WS_EX_LEFT / WS_VISIBLE / ES_MULTILINE / ES_AUTOVSCROLL;
SetWindowLong(hwndTextBox,GW_STYLE, WordwrapStyle);
SetWindowPos(hwndTextBox,0,0,0,0,0,SWP_NOMOVE / SWP_NOSIZE / SWP_NOZORDER / SWP_FRAMECHANGED);
This does NOT work, and I can''t see why...
Any help?
Big Al
Two possible problems one, no where in the documentation do I see GW_STYLE defined, I DO however see GWL_STYLE defined.
Problem two, you are including an EX style in your style definition. There are two seperate window properties, the Style and the ExStyle.. hense there is GWL_EXSTYLE as well. (In other words take out the WS_EX_LEFT and it should work, if you want to change an Ex style use the GWL_EXSTYLE, otherwise use GWL_STYLE)
-Omalacon
Problem two, you are including an EX style in your style definition. There are two seperate window properties, the Style and the ExStyle.. hense there is GWL_EXSTYLE as well. (In other words take out the WS_EX_LEFT and it should work, if you want to change an Ex style use the GWL_EXSTYLE, otherwise use GWL_STYLE)
-Omalacon
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement