top of page
  • John

Make a UserForm transparent

Updated: Jul 29, 2022

The following code will make the entire UserForm transparent. I'm sure there is a practical use for this, I'm just now sure what it is!


1. In the UserForm's code in the declarations area, add the Windows API calls and associated constants

​​


2. And in the UserForm's code area below the declarations, add the SetTransparency procedure

​​


3. And from the UserForm_Initialize event, call the SetTransparency procedure


4. That's it. The only thing left to do is to display the UserForm (in this example called UserForm1) from a standard code module eg



This is the result:


Transparent UserForm



1 comment

1 comentário


J. Woolley
J. Woolley
11 de ago. de 2022

Together with "Hide a UserForm's title bar," this is useful as a semi-transparent light-box. For example, it can be used to obscure the ActiveWindow behind a progress-bar. See user forms F_Lightbox and F_ProgressBar at https://sites.google.com/view/MyExcelToolbox/

J. Woolley

Curtir
bottom of page