Hey All.
I'm needing a fully transparent label to rest over a picture field that gets resized from calculations. The picture field is simple a background image in a PictureBox that represents a percentage of a whole. The label stores the actual percentage text.
Here's the issues I've come across:
- Making the Picture Box a panel and instead placing the Label in it will hide the label if the percentage is too small
- Adding a Label on top of the Picture box and setting it to transparent get thes Forms background color, not the picture that it is over
- I couldn't get the _Paint to set the text to work at all for some reason (I'll post code below)
- Setting the Labels parent to the PictureBox seems to take way too much code for what it does
private void pictureBar_Paint(object sender, PaintEventArgs e)
{
using (Font myFont = new Font("Arial", 14))
{
e.Graphics.DrawString("test", myFont, Brushes.Green, new Point(2, 2));
}
}
I've been searching for a few hours now and I can't find any really applicable way to tackle this. Anyone have any ideas/suggestions?
I also found this: http://www.doogal.co.uk/transparent.php
It may work but I can't seem to get it to show up on my form. Is there a way to add it to the toolbox so I can drag-and-drop it? Creating a new TransparentLabel, setting the location, text and visibility doesn't get it to show up.