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?
I am writing my own control that will contain a panel with text, images
Share
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?