tags:

views:

155

answers:

2
+1  Q: 

Form-only opacity

Hello,

First I'm going to show you an image of what I'm trying to recreate in pure NET.

Image

I recreated the window "Inventory" ,the only thing left is the blue-opacity window ,which shows information.

If I use the opacity property then everything on that form has opacity,but on the picture the text doesn't have opacity.

How do I make the opacity only on the form?

A: 

Not sure if this helps but the only thing I can think of short of using WPF would be to use TransparencyKey and backcolor of the form. Just make sure your TransparencyKey is not set as default control or gray, may the backcolor of the form red or something. If your looking for partial transparency you might end up having to use WPF. Personally I've never tried opacity with WPF on an actual form so you "may" get the same results but...

EDIT: WPF causes the same condition. All controls under the form become transparent with the form. Probably because they inherent the forms properties.

Phillip
+1  A: 

The Opacity property only exists on the form so there's no way it could be overridden on the controls contained therein.

I did think that a slightly transparent background image might give the effect you wanted - but I've just tried it and it didn't seem to work.

ChrisF
Doing the transparent background image, if I remember causes the transparency to fade to the forms background color. Unless my memory is failing me.
Phillip
@Philip - possibly. I did a quick test and it didn't work as I expected. There might be a way round this but it's not immediately apparent.
ChrisF
I upvoted your answer for your effort and if there's no answers lately I will mark it as accepted,but I truly believe this is doable with WinForms/WPF
John