views:

173

answers:

2

I am writing my own control that will contain a panel with text, images and other media. What is the best way to render the text and images. The control may contain long texts and many images.
Should I add the text as labels and images as PictureBox or should I use the DrawString and DrawImage methods to render the text and images?
What's the best way to do this?

+2  A: 

If you use labels, then you get all the labelly goodness for free.

If you use DrawString, then it'll probably be (a little bit) faster, but it's a lot more complicated if you need to deal with things like the text changing.

The OnPaint handler is a always a tricky one to write, and invalidating the client area is tricky to do efficiently.

Why not let the labels handle it all for you?

David Kemp
+1  A: 

i would use DrawString and DrawImage you have less resources to worry about but with added complexity.

I don't think its that bad drawing your own strings and images once your get into it.

this is a nice intro to it:

http://www.bobpowell.net/

Hath