Results 1 to 3 of 3

Thread: The french man needs your knowledge about Richtextbox

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2000
    Posts
    6

    Cool

    Hi,

    In the project that I do, I have to enable the user to move the richtextbox that he created. So I put the event "text.move" on mouse move but it just moves a shape and the richtextbox still sticks on the form.
    And about resizing it, in fact I would like that when the user adds some text in the richtextbox, the box be automatically resized with the right height and width to display all the words.

    Thanks for your answer.

  2. #2
    Randalf the Red honeybee's Avatar
    Join Date
    Jun 2000
    Location
    off others' brains
    Posts
    4,345

    Well ....

    Try changing the .Left and .Top properties of the RTB control.

    I am not a complete idiot. Some parts are still missing.
    Check out the rtf-help tutorial
    General VB Faq Thread
    Change is the only constant thing. I have not changed my signature in a long while and now it has started to stink!
    Get more power for your floppy disks. ; View honeybee's Elite Club:
    Use meaningfull thread titles. And add "[Resolved]" in the thread title when you have got a satisfactory response.
    And if that response was mine, please think about giving me a rep. I like to collect them!

  3. #3
    Guest
    Try the following. To prevent confusion between when the user wants to type or drag, the code has been placed in the DblClick() event.

    Code:
    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 ReleaseCapture Lib "user32" () As Long
    Const WM_SYSCOMMAND = &H112
    Const WM_MOVEEX = &HF012
    
    Private Sub RichTextBox1_DblClick()
        ReleaseCapture
        SendMessage RichTextBox1.hwnd, WM_SYSCOMMAND, WM_MOVEEX, 0&
    End Sub

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