posted 09-11-2008 11:15 AM
By turning on and off the horizontal scrollbar, this should allow you to turn On and Off the wordwrap feature of the richedit control.Here is a subroutine which does this for you (requires the win32api.inc to be included for the API calls):
code:
SUB EZ_ToggleWordWrap(BYVAL FormName$, BYVAL RichID&, BYVAL WrapFlag&)
LOCAL hCtrl&, Op&, WS&, V&
hCtrl&=EZ_Handle(FormName$, RichID&)
WS&=GetWindowLong(hCtrl&, %GWL_STYLE)
IF WrapFlag& THEN
WS&=WS& OR %WS_HSCROLL OR %ES_AUTOHSCROLL
V&=1
ELSE
WS&=WS& AND NOT(%WS_HSCROLL OR %ES_AUTOHSCROLL)
V&=0
END IF
SetWindowLong hCtrl&, %GWL_STYLE, WS&
SetWindowPos hCtrl&, 0,0,0,0,0,%SWP_DRAWFRAME OR %SWP_FRAMECHANGED OR %SWP_NOMOVE OR %SWP_NOOWNERZORDER OR %SWP_NOSIZE OR %SWP_NOZORDER
SendMessage hCtrl&, %EM_SETTARGETDEVICE, 0,V&END SUB
[This message has been edited by Chris Boss (edited 09-12-2008).]