Results 1 to 28 of 28

Thread: [RESOLVED] [VB6(windows 7) - richtextbox] - how show the scrollbars?

Threaded View

  1. #22

    Thread Starter
    PowerPoster joaquim's Avatar
    Join Date
    Apr 2007
    Posts
    3,961

    Re: [RESOLVED] [VB6(windows 7) - richtextbox] - how show the scrollbars?

    another important tip. by some reason, the richtextbox must be updated after change the WordWrap() (that's why you moved the control). so i change my sub:
    Code:
    Option Explicit
    
    Private Const WM_USER = &H400
    
    Private Const EM_SETTARGETDEVICE = (WM_USER + 72)
    Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal _
    hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
    Private Declare Function UpdateWindow Lib "user32" (ByVal hwnd As Long) As Long
    
    Public Sub WordWrap(ControlHandle As Long, ActivateWordWrap As Boolean)
        If ActivateWordWrap = False Then
            SendMessage ControlHandle, EM_SETTARGETDEVICE, 0, ByVal -1&
        Else
            SendMessage ControlHandle, EM_SETTARGETDEVICE, 0, ByVal 0&
        End If
        UpdateWindow ControlHandle
    End Sub
    why i did these change? because in usercontrol wasn't working
    but the move code give me the Update ideia and i used it and works
    now, i have totally tested, works fine in forms and usercontrols.
    i accept sugestions about these sub
    thanks for all
    Last edited by joaquim; Jun 9th, 2013 at 04:51 PM.
    VB6 2D Sprite control

    To live is difficult, but we do it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width