Solved

dynamic richtextbox in a panel not showing image

Posted on 2006-11-17
1
292 Views
Last Modified: 2010-05-18
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?
0
Comment
Question by:dotnet22
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 48

Accepted Solution

by:
AlexFM earned 500 total points
ID: 17970502
RichTextBox r = new RitchTextBox();

This is not enough to create control. You need to add it to Controls collection of parent control and then show it. Maybe after this r.Paste will work.
0

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Suggested Courses

632 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question