Special form

R

Ron M. Newman

Hi,

I need to create a form that'll have no frame (I know how to do that) with
the following properties:

1) background color with 50% opacity
2) rest of the elements on the form 100% opacity.

so far I've only found out how to change the opacity of the entire form. how
do I separate things? do I have a "shape" control that I can stretch across
my form with opacity controls?

Thanks
Ron
 
S

Stoitcho Goutsev \(100\)

Ron,

Why don't just set the FormBorderStyle to None. Opacity won't help you here.
 
R

Ron M. Newman

hi,

Yes, that's the problem I can solve, but I also need a 50% opacity
background and 100% opacity "text" on top of that background. How do I
achieve that is the big question.

thanks
Ron
 
M

Michael C

Ron M. Newman said:
hi,

Yes, that's the problem I can solve, but I also need a 50% opacity
background and 100% opacity "text" on top of that background. How do I
achieve that is the big question.

You want your form to be 50% trasparent but all controls and labels on it
not to be transparent? You should be able to set each control that has a
hWnd using the same API you set the form with but you won't have any luck
with labels and other windowless controls because they don't have a hWnd.
You'll need to place them on a control that does have a hWnd, eg a frame or
create your own usercontrol.

Michael
 
S

Stoitcho Goutsev \(100\)

Michael,

I might be worng here, but setting the transparency uses layered windows
feature. Only a top-level window (form) can be layered and it affects all
controls on it.
Again I might be wrong, but think what Ron is after is most likely
impossible to be done on Windows.

Is there are an example of this implemented in an application?
 
R

Ron M. Newman

I am thinking of resorting to this trick:

i need:

1) 50% opacity background
2) 100$ opacity text.

I'll use:

1) a form with 50% opacity
2) another transparent form above it (owned by the 50% form) that's 100%
opacity. where i'll adjust sizes and positions based on events.

will that work?

Ron
 
S

Stoitcho Goutsev \(100\)

Ron,

Isn't it the fully opaque form cover fully semitransparend one underneath.

Are you trying to achieve something like the new Vista Aero look and feel
where the windows has semitransparent borders and captions? It might work in
this case, but I don't know how well and smooth the form on top will follow
the other form.
 
R

Ron M. Newman

well, I gotta try. The alternative is to do the whole appha blending
processing myself and take over the paint... ... taking a snapshot of the
desktop or whateveris underneath my window... arghhh painful! which might
not be a bad idea but then again, I'd rather not...

my need is simple. 50% opaque background, 100% opaque text above it.

Ron
 
S

Stoitcho Goutsev \(100\)

Yes, give it a shot. Just a little worning taking a snapshot of part of the
window that is not visible (covered, out of the screen or minimized) is not
an easy task and in some cases impossible.
 
M

Michael C

Ron M. Newman said:
well, I gotta try. The alternative is to do the whole appha blending
processing myself and take over the paint... ... taking a snapshot of the
desktop or whateveris underneath my window... arghhh painful! which might
not be a bad idea but then again, I'd rather not...

I doubt that will work terribly well if you could get it working.
my need is simple. 50% opaque background, 100% opaque text above it.

I doubt the 2 forms method will work, 1 will always have to move before the
other causing a jumpy look.

Michael
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top