Form Fade In/Out

isladogs

MVP / VIP
Local time
Today, 03:59
Joined
Jan 14, 2017
Messages
18,534
Someone sent me code to allow a form to fade in on load and fade out on close.
He/she offered it as a possible addition to my Attention Seeking example database.
Unfortunately I can't remember who it was.

Attached is an example using a slightly modified version of the code supplied.
Could the original author please contact me so I can acknowledge them.... (y)

EDIT
IIRC, the same person also sent me code for creating rounded corners on forms. Purely as a visual effect with no other purpose.
As an extreme example, you can even create circular forms if that rocks your boat!
If anyone is interested, I'll upload an example of that code as well.
 

Attachments

Last edited:
Would love to see the rounded corner code.
 
even the Option Compare Text is the same.
see the attribution.
Code:
Option Explicit
Option Compare Text
Option Private Module

'KPD-Team 2000
'URL: http://www.allapi.net/
'E-Mail: KPDTeam@Allapi.net

'But somewhat modified by me.

Private Const LWA_ALPHA = &H2
Private Const GWL_EXSTYLE = (-20)
Private Const WS_EX_LAYERED = &H80000

'*Constants for SetLayeredWindowAttributs
Private Const LWA_COLORKEY As Long = 1

Private Declare PtrSafe Function GetWindowLong Lib "user32" _
                                       Alias "GetWindowLongA" (ByVal hwnd As Long, _
                                                               ByVal nIndex As Long) As Long

Private Declare PtrSafe Function SetWindowLong Lib "user32" _
                                       Alias "SetWindowLongA" (ByVal hwnd As Long, _
                                                               ByVal nIndex As Long, _
                                                               ByVal dwNewLong As Long) As Long

Private Declare PtrSafe Function SetWindowOpacity Lib "user32" _
                                          Alias "SetLayeredWindowAttributes" (ByVal hwnd As Long, _
                                                                              ByVal crKey As Long, _
                                                                              ByVal bAlpha As Byte, _
                                                                              ByVal dwFlags As Long) As Long

Public Declare PtrSafe Sub Sleep Lib "kernel32" (ByVal lngMilliSeconds As Long)
 
Pretty sure Stephen Lebans provided much of the original code for this and other graphics tricks
 
Attached is a modified version of the demo app that was originally sent to me by Jason Hayes for possible inclusion in my AttentionSeeking app..
Many thanks, Jason ...not sure if you are an AWF member

This is one of the 2 forms Jason sent me with all corners rounded:
1628598597991.png


NOTE: There is no close button. Click the footer section instead

I added this circular form whilst playing with the code.
1628598297240.png


Definitely not very practical but might grab users' attention?

After checking my emails, I had forgotten that Jason wasn't the author.
We agreed in an email exchange last April that it probably was Stephen Lebans as @CJ_London suggested.

I've tried to check the site www.allapi.net mentioned by @arnelgp but the site doesn't load.

Anyway, see attached if you are interested in playing with the code.
 

Attachments

Users who are viewing this thread

Back
Top Bottom