0

Trying to make a form's background transparent, without it losing its ability to receive clicks.

this.Opacity makes the whole form transparent (not just the background

BackColor = Color.Red; 
TransparencyKey = BackColor;

makes the background of the form transparent and click through-able. I want the form to be transparent , but it should be able to receive clicks

how?

Someone suggest overwriting WndProc to change HTCAPTION . BUt after trying that, the form is still click through-able

Also this form is also the 'base' form.

Thanks

3
Contributors
8
Replies
9
Views
7 Years
Discussion Span
Last Post by serkan sendur
0

Why not just take a picture of what is behind the form and show that, mimicing transparency?

It will be the base form . the main 'window' .
whatever that is behind the window will always be changing..

0

OK!
I hadn't thought of it that way. I'll look into it. thanks

btw I am novice, so I am wondering if this could make my app 'slower' on a low end machine

0

Absolutely. Every line of code that executes on a client machine slows your app down :)

The real question is -- Does this slow it down enough to matter? No, it doesn't. You should be fine.

0

hi again!
one problem - the form itself is included if copyfromscreen() is used to take capture screen. Is there a way to take a capture of the window behind the form?

In OnPaint() ->

Point zero = new Point(0,0) ;
Graphics g = pea.Graphics ;
g.CopyFromScreen(this.Location, zero, this.Size);

OnPaint() is being called every second with a Timer. I guess I have to change this.Location..

my form is topmost btw..

Edited by kutchbhi: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.