to insert images in the Richtextbox using c# language in windows application.

Posted by Vish2012 under ASP.NET on 5/10/2012 | Points: 10 | Views : 5146 | Status : [Member] | Replies : 2
How to insert images in the Richtextbox using c# language in windows application.

Can anyone tell me that "How to insert images in the Richtextbox using c# language in windows application".
For eg. I took one rich text box. In that i wrote some text and put image control but when i scroll the text is moving up but the image is not moving up, it is remaining as it is.

So anyone can tell that how it wil work. Pls help.




Responses

Posted by: Gudevg on: 5/10/2012 [Member] Starter | Points: 25

Up
0
Down
It is just similar to copy a image into word file.

Refer this:

http://www.daniweb.com/software-development/csharp/threads/229665/how-to-load-.doc-file-into-richtextbox
http://forums.asp.net/t/1474743.aspx

Regards,

Deepakkumar G.

Vish2012, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sakthi.Singaravel on: 5/10/2012 [Member] Silver | Points: 25

Up
0
Down
try this code..

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

OpenFileDialog1.Filter = "All files |*.*"
OpenFileDialog1.Multiselect = True
Dim orgdata = Clipboard.GetDataObject
If OpenFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
For Each fname As String In OpenFileDialog1.FileNames
Dim img As Image = Image.FromFile(fname)
Clipboard.SetImage(img)
RichTextBox1.Paste()
Next
End If
Clipboard.SetDataObject(orgdata)
End Sub


Regards,
Singaravel M

Vish2012, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response