Transparent Control to be placed of a picturebox?

The problem you are running into is that WinForms controls do not support true transparency, and getting them to do so can be a bit tricky. What they do is paint the child control under themselves (when transparency is enable via SetStyle), but this has its own quirks. You should first try something like this.

The problem you are running into is that WinForms controls do not support true transparency, and getting them to do so can be a bit tricky. What they do is paint the child control under themselves (when transparency is enable via SetStyle), but this has its own quirks. You should first try something like this: // in your custom control class... protected override CreateParams CreateParams { get { CreateParams cp = base.

CreateParams; cp. ExStyle |= 0x00000020; //WS_EX_TRANSPARENT return cp; } } I have found this method to be more reliable than the following, but you should try this as well: public MyTransparentControl() { SetStyle( ControlStyles. SupportsTransparentBackColor | ControlStyles.

AllPaintingInWmPaint | ControlStyles. UserPaint, true ); BackColor = Color. Transparent; } As an alternative approach, have you considered using WPF instead of WinForms?

I know this is not always an option, but if it is you will make your life a whole lot easier as WPF controls support transparency and control layering out of the box.

The first example works a bit better than the second. The background of the label, and of the picture box in my control are still there. The rest of the control is invisible.

Can that example be extended to those items? – Jason Aug 19 at 18:47 @Jason: You don't have to worry about TransparencyKey using this method. You'll need to do the same for every control that should have a "transparent" background.

This means deriving your own Label class, etc. However, it may be sufficient to use the second example for the label (SetStyle is a public method) and use the first example for the main overlay control. – Ed S. Aug 19 at 20:23.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions