PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: Martin Francom on June 10, 2010, 12:22:07 AM

Title: Wordwrap in RichEdit control
Post by: Martin Francom on June 10, 2010, 12:22:07 AM
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?



Title: Re: Wordwrap in RichEdit control
Post by: Martin Francom on June 10, 2010, 01:27:46 AM
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?
Title: Re: Wordwrap in RichEdit control
Post by: José Roca on June 10, 2010, 01:49:14 AM
See the EM_SHOWSCROLLBAR message:
http://msdn.microsoft.com/en-us/library/bb774298%28VS.85%29.aspx
Title: Re: Wordwrap in RichEdit control
Post by: Rolf Brandt on June 10, 2010, 04:53:48 AM
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 (http://msdn.microsoft.com/en-us/library/bb773165(v=VS.85).aspx)
Title: Re: Wordwrap in RichEdit control
Post by: Martin Francom on June 10, 2010, 12:56:25 PM
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
Title: Re: Wordwrap in RichEdit control
Post by: Martin Francom on June 10, 2010, 01:12:36 PM
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
Title: Re: Wordwrap in RichEdit control
Post by: Roger Garstang on June 11, 2010, 01:55:23 PM
I love WinSpector, although finding links to it to give to people is becoming harder. We need a Files/Utilities section here.