Hello Can I put a GIF picture in Rich TextBox? how? Thanks
Try the following: VB Code: Option Explicit Private Declare Function SendMessageByLong& Lib "user32" _ Alias "SendMessageA" _ (ByVal hwnd&, ByVal wMsg&, ByVal wParam&, ByVal lParam&) Private Const WM_PASTE& = &H302 Private Sub Command1_Click() Clipboard.Clear Clipboard.SetData LoadPicture("c:\myimage.gif"), vbCFBitmap Call SendMessageByLong(RichTextBox1.hwnd, WM_PASTE, 0, 0) Clipboard.Clear End Sub
Option Explicit Private Declare Function SendMessageByLong& Lib "user32" _ Alias "SendMessageA" _ (ByVal hwnd&, ByVal wMsg&, ByVal wParam&, ByVal lParam&) Private Const WM_PASTE& = &H302 Private Sub Command1_Click() Clipboard.Clear Clipboard.SetData LoadPicture("c:\myimage.gif"), vbCFBitmap Call SendMessageByLong(RichTextBox1.hwnd, WM_PASTE, 0, 0) Clipboard.Clear End Sub
Microsoft MVP - Visual Basic 2006-2013 Why VB clears the clipboard on startup and how to avoid it? . Filtering Arrays . Save File To Database . Extract File From Database . Extract picture from database without using hard drive . Change Menu BackColor . How to use MS Flexgrid . Make Frame Transparent . The Easiest Way to Create an NT Service With VB6 . How to comment blocks of code in VB5 and VB6 . How to find and replace missing members of control array Visual Basic 6.0 On-Line Documentation . Connection Strings
But the GIF Picture doesn't move.
What did you expect? RTB is not a player - it's a text editor that allows to display static images (and thanks for that...).
OK how does it work in TextBox of MSN Messenger & Yahoo? Is it Rich TextBox or not?
How would I know? I didn't develop any of those...
However, thank you very much RhinoBull for replying and helping.
np,
I don't think it is a RichTextBox in their program. Probably a web browser or something that can display animated GIFs. You would have to use an API spy program or something to get the Classname of the chat window to see what they're using.
Thanks very much
You may use an image control. You may read each frame of a GIF file then show it in the Image Control.
Forum Rules