Wordwrap in RichEdit control

Started by Martin Francom, June 10, 2010, 12:22:07 AM

Previous topic - Next topic

Martin Francom

How do I turn on wordwrap in the Richedit control?

I thought there might be a setting in the "Properties" "WindowStyles" for the Richedit Control.  But I am not seeing it.  Shouldn't that property  be settable there?




Martin Francom

#1
Ok,
   I found this method... Seems to work.

   'Set the RTF control to have word wrap on
   SendMessage HWND_FORM1_RICHEDIT1, %EM_SETTARGETDEVICE, 0, 0 


But now I need to know if there is a way to programmatically turn on or off the Horizontal ScrollBar?


Rolf Brandt

This little tool by Microsoft might also be very handy.

Control Spy 2.0 is a tool that helps developers understand common controls: how to apply styles to them, and how they respond to messages and notifications. Using Control Spy, you can immediately see how different styles affect the behavior and appearance of each control, and also how you can change the state of each control by sending messages.

http://msdn.microsoft.com/en-us/library/bb773165(v=VS.85).aspx
Rolf Brandt
http://www.rbsoft.eu
http://www.taxifreeware.com
I cook with wine, sometimes I even add it to the food.
(W. C. Fields)

Martin Francom

Jose' would this be correct usage.
 
   SendMessage HWND_FORM1_RICHEDIT1, %EM_SHOWSCROLLBAR , wParam, lParam

where:

wParam
Identifies which scroll bar to display: horizontal or vertical. This parameter must be %SB_VERT or %SB_HORZ.

lParam
Specifies whether to show the scroll bar or hide it. Specify TRUE to show the scroll bar and FALSE to hide it.


That seems simple enough.  i will give it a try ...  Thanks

Martin Francom

Rolf,
   Yes, ControlSpy is very handy.  Thanks for the reference.  And by adding this tool to FireFly's Tools List it become very handy indeed!  :D

Roger Garstang

I love WinSpector, although finding links to it to give to people is becoming harder. We need a Files/Utilities section here.