I have been looking for several hours now trying to figure out how to display a transparent back-color label over other controls. I have a user-control with tons of controls in it such as text-boxes, combo-boxes, etc. I want to display a BIG RED LABEL titled "VOID" over this user-control sometimes when the control is displayed. But I want the user to still be able to read the data in the controls behind the label.

When I set the back-color property to transparent, it doesn't seem to work. I have also tried creating a custom label and over-riding the CreateParams property. Nothing seems to work.

PLEASE HELP!!!

Recommended Answers

All 3 Replies

I have also now tried making a graphics and using the drawstring method. However, I once again cannot figure out a way to make the graphic the top most control over the other controls. I even changed the other controls z-order.

PLEASE HELP!!! DESPERATE!!

You should just beable to bring the label control to the front. which i think does nothing more then changes the order of the controls being added to the form, in a way which the label should be added before the other control to have the 'on top' appearence
higher is first and lower is added next

If you read my second comment, you will notice that I have already tried the z-order and it did not work either. After much sweat and tears, I have finally found a solution. The problem is that when you set the background color to transparent, all that it does is basically change the background of the label to whatever the background color of the parent control is. This is not true transparency b/c it does not work over other controls drawn on the parent control. I finally found a WONDERFUL solution at the following link:

http://www.codeproject.com/cs/miscctrl/SimpleLine.asp

Many thanks to everyone out there who has read, thought about, or tried to help me in such a simple but complicated problem.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.