richtextbox插入图片

 

代码
   
     
// richtextbox可以当容器使用,
PictureBox pb = new PictureBox();
pb.Image
= ( new Icon( " App.ico " )).ToBitmap();
this .richTextBox1.Controls.Add(pb);


///////////////////////////////// //

public void InsertImage()
{
bool b = rtb1.ReadOnly;
Image img
= Image.FromFile( " sss.bmp " );
Clipboard.SetDataObject(img);
rtb1.ReadOnly
= false ;
rtb1.Paste(DataFormats.GetFormat(DataFormats.Bitmap));
rtb1.ReadOnly
= b;
}

 转载自:http://www.cnblogs.com/zhangjidong/archive/2005/06/16/175536.html

你可能感兴趣的:(text)