Find Code:
All Words
Any of the Words
Exact Phrase
Home
:
Code
:
Forums
:
Submit
:
Mailing List
:
About
:
Contact
Code
All
VB.NET
ASP.NET
C#
VB Classic
ASP Classic
Snippets
Popular
Resources
Submit Code
Forums
Articles
Tips
Links
Books
Contest
Link to us
Adding any image into a rich textbox
Author:
DanTheMan
E-mail:
Click to e-mail author
Submitted:
6/20/2004
Version:
VB6
Compatibility:
VB6
Category:
Controls
Views:
29598
This allows you to insert a picture into any rich textbox, very good for word processors :)
Declarations:
Declare this in a module: Public 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
Code:
'add a rich textbox, a button and an image control of the image you want to insert. 'Apply this code to the button Private Sub Command1_Click() 'Clear the contents of rtb1 rtb1.Text = "" 'Clear the clipboard Clipboard.Clear 'Populate the clipboard with image 1's picture Clipboard.SetData Image1.Picture 'Add it to rtb1 SendMessage rtb1.hwnd, WM_PASTE, 0, 0 End Sub
Home
|
Forums
|
Submit
|
Books
|
Mailing List
|
Advertising
|
About
|
Contact
© 2024 A1VBCode. All rights reserved.
Legal disclaimer & terms of use
Privacy statement