Microsoft Office Tutorials and References
In Depth Information
Making a UserForm Semitransparent
Figure 15-26: A semitransparent UserForm.
Figure 15-27 shows an Excel workbook that uses the light-box effect. Excel’s window is dimmed,
but the message box displays normally. How does it work? I created a UserForm with a black
background. Then I wrote code to resize and position the UserForm so that it completely covers
Excel’s window. Here’s the code to accomplish the coverup:
With Me
.Height = Application.Height
.Width = Application.Width
.Left = Application.Left
.Top = Application.Top
End With
Then, the UserForm was made semitransparent, which gives Excel’s window a dimmed
appearance. The message box (or another UserForm) is displayed on top of the semitransparent
This workbook is available on the companion CD-ROM. The filename is excel
light-box.xlsm .
Search JabSto ::

Custom Search