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.Ge tManifestR esourceStr eam(iconNa me);
System.Drawing.Image image = Image.FromStream(strm);
RichTextBox r = new RitchTextBox();
Clipboard.SetDataObject(im age);
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?
string iconName = "MyIconName.gif";
System.IO.Stream strm = null;
strm = this.GetType().Assembly.Ge
System.Drawing.Image image = Image.FromStream(strm);
RichTextBox r = new RitchTextBox();
Clipboard.SetDataObject(im
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.