This article supporting source code
Yesterday a friend asked the Windows Form in the picture transparent problem, just look at the Internet, saw this article on the CodeProject, feel that write well, moreover oneself always want to learn translation technology articles, so it translated into Chinese, hope to bring some help.
Affirmation: The first translation of such articles, is a debut, inevitably have the wrong place, you are welcome to Pat brick Advice! ^_^
OK, start the body ...
Introduction-Windows Forms without transparency
If you make a complex form that includes pictures and labels, you may find that Windows Forms do not support real transparency. You may have torn your scalp--but it's still not resolved!
Even if you use a transparency value on the BackColor property of a picture or label, the result is that you still find it impossible to make it transparent. So, what is this for? Why is it clearly set to transparent, but not transparent? What the hell is going on?
In fact, when you set the transparency value on the BackColor property to control it, just set its background to the same background as the parent form--windows form, and there is no real transparency! So when they overlap, you will still find that they are not transparent to each other, as shown in the following figure:
In this article, we'll show you a simple way to make the tag's back picture as a background and how to make the picture and text truly transparent.
How to make transparent labels
Is it really easy to make a picture appear as a background with labels or text in front of it?
In the following, we will explain how to make the label background transparent.
There are two ways you can use it to label the background transparently (in fact there are more ways to do this, but we're just going to talk about simpler):
1. By setting the BackgroundImage property of the panel and placing the label lable inside it
2. Sets the lable parent form to PictureBox (label.parent = PictureBox)
In this way, we will not need to write any code, and we can immediately see the effect of its transparency in the designer: