using a transparent image for userform label or frame

bradyboyy88

Well-known Member
Joined
Feb 25, 2015
Messages
562
I need to assign an image to the picture attribute of a label or frame. The only issue is the image has transparency to it. Is there any format that excel supports which allows transparency or a way to make this work?
 
I don't know how to attach smthg here, but i made a Test file.

Form1, big with a button.
Form2 small empty.

Button runs the above mentioned code.
Works flawless.

I put a List box on the form1, it doesn't work anymore (see screenshot)

Screen Shot 10-21-22 at 07.01 PM.PNG
 
Upvote 0

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Hi pflosch

Is it possible for you to upload here a copy of the workbook that you are having problems with (after removing any sensitive data)?

Upload the workbook to some file sharing site such as Box.net and post the link here.

EDIT: Are you using x32 or x64 excel ?
 
Upvote 0
64bit excel.
I do not have any account on such file sharing sites...
But it's reproducible in 2 min on an empty form with a listbox and a button
 
Upvote 0
See if the following update works for you... I have left the tab and arrow keys enabled so you can navigate the listbox... Zoom is also working.

Check out Test 2 as it is a simpler userform, easier to follow and similar to what you want.

FormBrightness_V2.xlsm

If this update works for you as intended , I will add a couple of of bits to the code and will post it here later.
 
Upvote 0
Very nice :)

Since I only need to dim the entire back form, I removed the exclusion of Listboxes and Textboxes. Perfect.
I implemented it on many forms and tested, so far it works flawlessly.

A funny point:
When closing the small form, the position of the big form changes, I think it gets positioned in center of screen.
I mitigated by just saving position of the main form before showing the small form and restoring it when closing the small form.

Thank you very much, Jaafar. You're the Guru.
 
Upvote 0
Very nice :)
A funny point:
When closing the small form, the position of the big form changes, I think it gets positioned in center of screen.
I mitigated by just saving position of the main form before showing the small form and restoring it when closing the small form.

Didn't experience that oddity.

Anyways, thanks for the feedback and happy that it worked for you in the end. (y)

I will see if I can place the api code in a class module so that we can apply the dimming functionality to more than one userform all loaded at the same time.
 
Upvote 0
Oh, cool, I was even thinking "that would be great to do the same thing from "sub-sub-form".

Rgd the screen pos, i move and resize that form at "initialize" to a saved position and size, so I guess it's related to that.
But it's really easy to move it back, so no issues anyway.
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,849
Members
452,361
Latest member
d3ad3y3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top