From: emotionalone on
Hello guys, I got refered here from daniweb on the control transparency
subject.
I like dynamic forms, so I wanna to transition between a 'register' and
'mange' interface by rearranging the controls that the previous dialog had,
all on the same panel, creating the necessary controls when phasing into one
dialog, or making others that already exist, previously invisible, visible.
Any idea on how to make this happen? My idea is to, for example, make a
button partially transparent, let's say a 50% opacity, and then move it
around the form to its new position, and then back to opacity 100%. Doing
this is no problem with no opacity change, but I'd like to make a nicer
looking transition with the changed opacity on the controls, any kind of
control.
I'm a 2nd year software engineering major using Visual C++ 2008 Express
Edition.
Thanks for the answers in advance.

From: Jackie on
On 5/22/2010 07:43, emotionalone wrote:
> Hello guys, I got refered here from daniweb on the control transparency
> subject.
> I like dynamic forms, so I wanna to transition between a 'register' and
> 'mange' interface by rearranging the controls that the previous dialog
> had, all on the same panel, creating the necessary controls when phasing
> into one dialog, or making others that already exist, previously
> invisible, visible.
> Any idea on how to make this happen? My idea is to, for example, make a
> button partially transparent, let's say a 50% opacity, and then move it
> around the form to its new position, and then back to opacity 100%.
> Doing this is no problem with no opacity change, but I'd like to make a
> nicer looking transition with the changed opacity on the controls, any
> kind of control.
> I'm a 2nd year software engineering major using Visual C++ 2008 Express
> Edition.
> Thanks for the answers in advance.

I know about layered windows at least:
http://msdn.microsoft.com/en-us/library/ms997507.aspx

But that does not work for child windows (controls).
One dirty trick may be place your control(s) onto a new layered window
and somehow place that window it on your real window, change its
transparency and position it as you want.
From: Jackie on
On 5/22/2010 10:54, Jackie wrote:
> He draws the controls manually though, and makes them blend with an
> image surface before paining it onto the window.

I guess that if you need the native look on your controls, you could use
the APIs OpenThemeData, DrawThemeBackground and all that and draw your
controls manually (with a native look):
http://msdn.microsoft.com/en-us/library/ff486120(v=VS.85).aspx

Here's some code that does that:
http://www.codeguru.com/cpp/controls/buttonctrl/advancedbuttons/article.php/c5161

Then somehow combine that with AlphaBlend like in the other example.
Sounds like quite some work, though.

If you want to use C++, that all I can think of except for using some
C++ framework that supports this already (but I don't really know any
that does).
From: Jackie on
On 5/22/2010 11:05, Jackie wrote:
> I guess that if you need the native look on your controls, you could use
> the APIs OpenThemeData, DrawThemeBackground and all that and draw your
> controls manually (with a native look):
> http://msdn.microsoft.com/en-us/library/ff486120(v=VS.85).aspx
>
> Here's some code that does that:
> http://www.codeguru.com/cpp/controls/buttonctrl/advancedbuttons/article.php/c5161
>
>
> Then somehow combine that with AlphaBlend like in the other example.
> Sounds like quite some work, though.
>
> If you want to use C++, that all I can think of except for using some
> C++ framework that supports this already (but I don't really know any
> that does).

Of course, if you're willing to go for Direct3D/OpenGL rendering, there
are frameworks for that, and maybe (hopefully) some that can render
controls with a native look.