Windows Animations, Fading, ...

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 guess not. :slight_smile:

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.

Would this help?

Just a quick clarification, my animation kit is pure Xojo code, not Core Animation. It means a potential performance hit on Mac, but a more consistent effect across platforms.

Really? I always assumed it was using Core Animation.
Does this means it also works for Windows?

Not sure if I can turn it into good effect for my needs but it would be great if you share the declares. :slight_smile:

[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.

Sure, no problem. Here is the method Christoph:

//Example 5-7
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 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)
End Sub

To make the translucence effect happen I added the following line of code to the Open event in Window1:

//0 = invisible, 255 = opaque TransControl(Window1, 155)

I hope this helps.

Here an example for Linux, Window Fade In / Fade Out


For what it’s worth, Windows has basic fading in/out effects built-in.