Link to home
Start Free TrialLog in
Avatar of dotnet22
dotnet22

asked on

dynamic richtextbox in a panel not showing image

I am dynamically adding RichTextBoxes to a panel dynamically. In each RichTextBox I am embedding an image as follows



string iconName = "MyIconName.gif";
System.IO.Stream strm  = null;
strm = this.GetType().Assembly.GetManifestResourceStream(iconName);
System.Drawing.Image image  = Image.FromStream(strm);

RichTextBox r = new RitchTextBox();
Clipboard.SetDataObject(image);
DataFormats.Format myFormat = DataFormats.GetFormat (DataFormats.Bitmap);
r.Paste(myFormat);


The image does not show up but if I apply the same code to a RichTextBox that is not added dynamically to the panel, then it shows up fine.... What do I need to do in order to have the embedded image show up?
ASKER CERTIFIED SOLUTION
Avatar of AlexFM
AlexFM

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial