How to Paste the Picture from PictureBox/Clipboard to Rich Text Box
Posted on January 5, 2009
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | 'Controls - How to Paste the Picture from PictureBox/Clipboard to Rich Text Box Option Explicit 'Add a Command Button, a Rich Text Box and a Picture Box to your form and Add a picture to the Picture Box. 'When you click the button, the picture box's picture will be copied to the clipboard, 'then it will be pasted to the Rich Text Box. Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, _ ByVal wParam As Long, lParam As Any) As Long Public Const WM_PASTE = &H302 Private Sub Command1_Click() Clipboard.Clear Clipboard.SetData Picture1.Picture SendMessage RichTextBox1.hwnd, WM_PASTE, 0, 0 End Sub |
Related posts:
- How to insert a picture into Rich Text box
- How to Insert Picture without Clearing Clipboard
- How to Copy and Paste the Picture
- How to check on which word the Mouse hover in Rich Text Box
- How to Display the Cursor’s coordinates of a Rich Text Box
- How to get the currently Selected Text in Rich Text Box
- How to goto the given line Number in Rich Text Box
- How to toggle Word wrap feature on Rich Text Box
- How to select portion of Picture and paste it to Picture Box
- How to add Picture to PictureBox at Run-Time








