PDA

View Full Version : Transparent UserForm With Visual Controls



oxicottin
01-01-2013, 08:40 PM
Hello, I have an example of a workbook UserForm that the background is completely transparent and it has a few sample controls such as labels and buttons that are completely visible with no transparency unless I set sections of the controls to be transparent by using vbBlack. Anyway my question is even though I wanted a transparent background with visible controls I wanted the background to be semi transparent set to a percent of 40%.

The code uses SetLayeredWindowAttributes;

Public Const LWA_COLORKEY which will only set the selected color transparent and I cant figure out how to set it semi Transparent. I tried using Public Const LWA_ALPHA and i could set the transparency but it sets transparency to everything including the UserForm.

Thanks,
Chad

GarysStudent
01-02-2013, 09:35 AM
Is this of any help?

http://thexlwiz.blogspot.com/2006/11/excel-userform-tricks.html

oxicottin
01-03-2013, 09:26 AM
Thanks for the link ill check it out....

oxicottin
01-04-2013, 07:02 PM
Is this of any help?

http://thexlwiz.blogspot.com/2006/11/excel-userform-tricks.html

95% dead links any other ideas? Thanks!

Aflatoon
01-07-2013, 06:34 AM
I don't believe there is any easy way to do this. The only similar thing I have seen mentioned was a post in xtremevbtalk that used a picturebox control to take a picture of the form and then used alphablending functions to create the semitransparency. SetLayeredWindowAttributes will not do what you want on its own, I fear.

oxicottin
01-07-2013, 06:50 AM
Thank you!... I will look for that post.

Aflatoon
01-07-2013, 08:05 AM
This (http://www.xtremevbtalk.com/showthread.php?p=1347012) was one of the posts I saw - note also the link to vb-fun part of the way down, where there is some code.

oxicottin
01-07-2013, 08:19 AM
URL="http://www.xtremevbtalk.com/showthread.php?p=1347012"]This[/URL] was one of the posts I saw - note also the link to vb-fun part of the way down, where there is some code.


Thanks again...