Results 1 to 4 of 4

Thread: [RESOLVED] RichTextBox Insert Image while locked??

  1. #1

    Thread Starter
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Resolved [RESOLVED] RichTextBox Insert Image while locked??

    I have this code:


    VB Code:
    1. For X = 0 To picSmile.UBound
    2.      If RTB1.Find(picSmile(X).Tag, tLoc) <> -1 Then
    3.           RTB1.SelStart = RTB1.Find(picSmile(X).Tag, tLoc)
    4.           RTB1.SelLength = Len(picSmile(X).Tag)
    5.           Clipboard.Clear
    6.           Clipboard.SetData picSmile(X).Image
    7.           SendMessage RTB1.hWnd, WM_PASTE, 0, 0
    8.      End If
    9. Next

    if the RTB is not locked or disabled.. it works fine...
    but I dont want the use to be able to copy or anything in the RTB

    with Enabled = False.. all the formatting looks right.. but the images wont insert...

    How do I get around this?

    Thanks!
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  2. #2
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171

    Re: RichTextBox Insert Image while locked??

    VB Code:
    1. [b]RTB1.Enabled = True[/b]
    2. For X = 0 To picSmile.UBound
    3.      If RTB1.Find(picSmile(X).Tag, tLoc) <> -1 Then
    4.           RTB1.SelStart = RTB1.Find(picSmile(X).Tag, tLoc)
    5.           RTB1.SelLength = Len(picSmile(X).Tag)
    6.           Clipboard.Clear
    7.           Clipboard.SetData picSmile(X).Image
    8.           SendMessage RTB1.hWnd, WM_PASTE, 0, 0
    9.      End If
    10. Next
    11. [b]RTB1.Enabled = False[/b]

    ?


    Has someone helped you? Then you can Rate their helpful post.

  3. #3

    Thread Starter
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Re: RichTextBox Insert Image while locked??

    lol.. too simple!! although I dont like the grey background so I will just do the Locked false / true
    !!!

    THANKS!!!!!!!
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  4. #4
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171

    Re: RichTextBox Insert Image while locked??

    Quote Originally Posted by Static
    lol.. too simple!! although I dont like the grey background so I will just do the Locked false / true
    !!!

    THANKS!!!!!!!
    You're welcome


    Has someone helped you? Then you can Rate their helpful post.

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