For OSX, MBS has some great classes to fade between tab sheets or page panels.
Thoms Animation Kit is also a superb tool for doing all sort of Core animations stuff.
imo It always lifts your apps to a higher level (GUI-wise).
But, is this also possible for Windows? Especially fade-in and fade-out of Pane-panels would be great.
I have a method with delcares which makes the Window and all of its controls translucent. If you want to make it look like its fading in or out then a timer can be used to change the translucence as you like to make that happen.
[quote=238969:@Christoph De Vocht]Really? I always assumed it was using Core Animation.
Does this means it also works for Windows?[/quote]
Yep, Linux too. It even has some support for iOS and Web, though Web would be horribly inefficient, and iOS… well preliminary support is there. Animation Kit wants to animate the controls themselves, but on iOS the correct action is to animate the autolayout bindings. It’ll compile for iOS, but the task classes for autolayout bindings just don’t exist. So you can’t move controls, but the other tasks work fine. Heck, it even compiles for console projects if you wanted to do text-based animations.
Sub TransControl(Wnd as Window, nTrans as Integer)
Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As integer, ByVal nIndex As integer, ByVal dwNewLong As integer) As integer
Declare Function SetLayeredWindowAttributes Lib "user32" (ByVal hwnd As integer, ByVal color As integer, ByVal bAlpha As Byte, ByVal alpha As integer) As integer
Const WS_EX_TRANSPARENT = &H20
Const GWL_EXSTYLE = -20
Const LWA_ALPHA = &H00000002
Const WS_EX_LAYERED = &H00080000
Dim hWnd as Integer
hWnd = Wnd.Handle
Dim Result as integer
'Changing GWL_EXSTYLE to WS_EX_LAYERED makes the window layered
Result = SetWindowLong(hWnd, GWL_EXSTYLE, WS_EX_LAYERED)
Result =SetLayeredWindowAttributes(hWnd, 000000, nTrans,LWA_ALPHA)
To make the translucence effect happen I added the following line of code to the Open event in Window1: