+ Reply to Thread
Results 1 to 10 of 10

Gradually Fade Userform Into View [Userform Fade Out Working Already]

  1. #1
    Registered User
    Join Date
    08-06-2012
    Location
    Providence, Rhode Island
    MS-Off Ver
    Excel 2007
    Posts
    6

    Gradually Fade Userform Into View [Userform Fade Out Working Already]

    This is my first post! Thank you all in advance!

    I am looking to have a userform gradually fade into view...

    I am creating a dashboard [win7x64/excel 2013] that will have activex buttons opening userforms. The code that I have acquired from this site [Many Thanks] and others uses Windows API calls to hide the userform titlebar and fade-out the userform. It looks great and works just as it is designed. I am basically looking to have the userform fade into view as it opens in the same manner that it fades out as it closes. I am thinking I need to mimic the "FadeAway" sub and create a "FadeIn" sub to handle this. Here is the current userform code [sample workbook attached]:

    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Gradually Fade Userform Into View [Userform Fade Out Working Already]

    perhaps (note I added 64bit compatibility as that is the system I use)
    Please Login or Register  to view this content.
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  3. #3
    Registered User
    Join Date
    08-06-2012
    Location
    Providence, Rhode Island
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Gradually Fade Userform Into View [Userform Fade Out Working Already]

    Hi Joseph (Josie?),

    Thank you for your response! I am not sure if you are noticing this on your machine, but when the userform loads there is an initial flicker. My best guess is that the form quickly loads with zero transparency, is then set to fully transparent and then starts to gradually fade in to zero transparency again. Any suggestions on how we can overcome the initial flicker? (I will live with it if i have to...)

    Other than that, thank you for adding the 64bit compatibility and for the help on the Fade In sub!

    -Aaron

  4. #4
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Gradually Fade Userform Into View [Userform Fade Out Working Already]

    hi Aaron,

    I didn't notice that but I wasn't really looking too closely. I only have access to a Mac at the moment so of course can't test but perhaps
    Please Login or Register  to view this content.
    by the way, it's Josie :-)
    Last edited by JosephP; 07-31-2013 at 02:53 AM.

  5. #5
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Gradually Fade Userform Into View [Userform Fade Out Working Already]

    you can also use the initialize event as long as you alter the semitransparent code to use the existing hwnd rather than the active window

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    08-06-2012
    Location
    Providence, Rhode Island
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Gradually Fade Userform Into View [Userform Fade Out Working Already]

    Good Morning Josie!

    Both of your suggestions work great. The userforms now open and close very smooth. Thank you for taking the time to look at this problem for me!

    - Aaron

  7. #7
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Gradually Fade Userform Into View [Userform Fade Out Working Already]

    you're welcome :-)

  8. #8
    Registered User
    Join Date
    08-06-2012
    Location
    Providence, Rhode Island
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Gradually Fade Userform Into View [Userform Fade Out Working Already]

    I wanted to post a follow up to this topic:

    I have added additional code that does the following:

    - Loads a full screen, semi-transparent userform to serve as a screen dimming effect.

    - Loads a secondary form on top of the background form with zero transparency. The effect of course to emphasize the secondary form.

    It works great as is, however, i would like the background to fade away upon closing the userform. I have attached an example workbook. Because I am calling the secondary form from the background form Activate sub, when I close the secondary form, if I don't put "unload Me" in the "ShowSecondForm" sub it goes into a nasty form opening loop. Any ideas on how to fade out the background userform after fading out the secondary userform?

    The code below is for the Background userform:UserformFade Part2.xlsm

    Please Login or Register  to view this content.

  9. #9
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Gradually Fade Userform Into View [Userform Fade Out Working Already]

    for the background form change the activate code to
    Please Login or Register  to view this content.
    and remove the unload statement from the ShowSecondForm routine

  10. #10
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Gradually Fade Userform Into View [Userform Fade Out Working Already]

    also rather than repeating all that code in each form you can use a class and reduce it a lot
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Brain fade in using an OR statement within an averageif function
    By Grimace in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-30-2012, 01:59 AM
  2. Userform fade not working from command buttons
    By berty2000 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 08-01-2011, 08:30 AM
  3. hopefully a Quicky - Am Having Serious Brain Fade!
    By AllenMead in forum Excel General
    Replies: 1
    Last Post: 07-14-2010, 09:22 AM
  4. fade in/out
    By ceemo in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-13-2006, 04:52 AM
  5. [SOLVED] Data/amounts in spreadsheets are sometimes dim and fade out !
    By tammyroxy in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-11-2006, 12:55 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1