Well...
2. I must set the parent control as ~WS_CLIPCHILDREN, the transparent
control can work. Because If I don't do it, Parent control will not repaint
the area occurred by transparent. The back ground of transparent Control
will not correct. But I don't think it is a good ideal.
If a window has style WS_CLIPCHILDREN it will clip off all the area
occupied by its child controls. Which means that it cannot draw on this
areas. Normaly this is what you want because you don't want to draw over
buttons, listboxes, etc. However if you have transparent child control you
should turn this style off becasue otherwise parent window cannot draw under
that control. All the drawing is clipped off and the effect is not what is
expected.
3. What's different between SupportTranparentBackColor and Opaque. If I set
control as SupportTranparentBackColor And set the BackColor, It's
transparent also. I know control will not paint back ground if I set it as
Opaque. They can implement Transparent control all. But I don't know who is
the really transparent control and what the different between them.
If you set SupportTranparentBackColor you can have translucent control.
Control paints the background, but it uses colors with alpha component less
then 255. When you use Opaque you either draw the background or not. You
cannot control the translucency.
When you use SupportTranparentBackColor it works with all the stuff drawn
one the parent control surface (Windows doesn't suport translucent colors
for control backgrounds so this is simulated by the framework, btw you can
use double buffering with that), but it do not take care of any sibling
controls. In other words control will cover all buttons, listboxes, etc,
which are underneath.
If you use Opaque you can do transparent control, but you need to remove
parent's WS_CLIPCHILDREN as well as the control should not cover any sibling
controls unless they don't have thier WS_CLIPSIBLINGS style removed. Anyways
you cannot use build-in double bufferning because nobody paints the
background and your bitmap will have black anywhere you haven't drawn.
The only solution would be to redesign your application and draw everything
in your own bitmap. Before the drawing fill the bitmap with color that you
going to use as a transparent color (key color).
When finish drawing in the bitmap. Transfer the bitmap on the screen
(frankly I haven't test it, but I believe you have to use parent's Graphics
object). Use Graphics.DrawImage that accepts ImageAttribute parameter and
set transparent color to be your key color.