Form Fade In/Out (1 Viewer)

isladogs

MVP / VIP
Local time
Today, 07:50
Joined
Jan 14, 2017
Messages
18,164
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

  • FadeInOut.zip
    28.7 KB · Views: 504
Last edited:

JonXL

Active member
Local time
Today, 02:50
Joined
Jul 9, 2021
Messages
153
Would love to see the rounded corner code.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 15:50
Joined
May 7, 2009
Messages
19,094
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)
 

CJ_London

Super Moderator
Staff member
Local time
Today, 07:50
Joined
Feb 19, 2013
Messages
16,521
Pretty sure Stephen Lebans provided much of the original code for this and other graphics tricks
 

isladogs

MVP / VIP
Local time
Today, 07:50
Joined
Jan 14, 2017
Messages
18,164
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

  • QuickDemoForColin.zip
    60 KB · Views: 471

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 15:50
Joined
May 7, 2009
Messages
19,094
how about shaped form with transparent
background.
 

Attachments

  • anotherShapedForm.accdb
    728 KB · Views: 451

Users who are viewing this thread

Top Bottom