[VB6] - align the richtextbox image-VBForums
Results 1 to 3 of 3

Thread: [VB6] - align the richtextbox image

  1. #1

    Thread Starter
    PowerPoster joaquim's Avatar
    Join Date
    Apr 2007
    Posts
    2,919

    [VB6] - align the richtextbox image

    i can put an image in richtextbox, by loafile or filename property. and if you click on image you can see some dots arround the image. but can i change image properties(like microsoft word)?
    VB6 2D Sprite control

    To live is difficult, but we do it.

  2. #2
    PowerPoster Spoo's Avatar
    Join Date
    Nov 2008
    Location
    Right Coast
    Posts
    2,656

    Re: [VB6] - align the richtextbox image

    Joaquim

    What code did you use to load the image?
    Could you attach an image of what you have.

    Spoo

  3. #3

    Thread Starter
    PowerPoster joaquim's Avatar
    Join Date
    Apr 2007
    Posts
    2,919

    Re: [VB6] - align the richtextbox image

    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 Const WM_PASTE = &H302
    'copy the image to clip board
    Clipboard.Clear
    Clipboard.SetData Picture1.picture,0
    
    'Insert the image in richtextbox
    SendMessage Form1.rtftext.hWnd, WM_PASTE, 0, 0
    but these image don't let you write the text like a background image only arround it.
    but for put 1 image background theres 1 tip
    make it transparent:
    Code:
    Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
    
    'important use these code before show the richtextbox(for you don't see 1 bug;))
    RichTextBox1.Text = ""
    SetWindowLong RichTextBox1.hWnd, -20, 32
    now... put the richtextbox in picturebox container(not on it(Zorder)). then you can put 1 image in picturebox and play with it by using the api functions
    and heres a bonus: http://www.planet-source-code.com/vb...xtbox&lngWId=1
    (moderators? if i can't use these link, please PM me... thanks)
    Last edited by joaquim; Jun 1st, 2011 at 06:58 AM.
    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
  •  



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.