UBBFriend: Email This Page to Someone!
  Computer Workshop User Forums
  EZGUI Source code
  Toggle WordWrap in RichEdit

Post New Topic  Post A Reply
profile | register | preferences | faq | search

next newest topic | next oldest topic
Author Topic:   Toggle WordWrap in RichEdit
Chris Boss
Administrator
posted 09-11-2008 11:15 AM     Click Here to See the Profile for Chris Boss     Edit/Delete Message Reply w/Quote
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).]

All times are EST (US)

next newest topic | next oldest topic

Administrative Options: Close Topic | Archive/Move | Delete Topic
Post New Topic  Post A Reply
Hop to:

Contact Us | Computer Workshop ( EZGUI ) Home Page

Copyright 2000 to 2007 Christopher R. Boss

Powered by: Ultimate Bulletin Board, Version 5.44
© Infopop Corporation (formerly Madrona Park, Inc.), 1998 - 2000.