LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to create custom shaped front panel

Solved!
Go to solution

I want to create a custom shaped popup window (other than rectangular shape). For this I have created a front panel with green (0x00FF00) background color, placed the shape I want as background image. Now the un-necessary part is in green color. I have then used a windows function (USER32.DLL: SetLayeredWindowAttributs) to make the green color transparent. It works for me, but the issue here is it takes some time to become transparent.For a fraction of a  second,the green color is visible to the user. Is there any other method to make some part of the window transparent ?

0 Kudos
Message 1 of 4
(3,148 Views)

Make your front panel hidden when open, use property node to make it visible after you called the SetLayeredWindowAttributs.

 

George Zou
0 Kudos
Message 2 of 4
(3,123 Views)

Thanks for your reply. I had already tried this method, but un-necessary parts (green colored part) not becomes transparent. I think SetLayeredWindowAttributs works only when the front panel is visible.

0 Kudos
Message 3 of 4
(3,104 Views)
Solution
Accepted by topic author jawadtld

You probably need to get it to keep the VIs front panel closed/hidden until after you have made the call to USER32.dll (and make that one of the first calls you make). It is probably opening your front panel when loading the VI so it shows the panel before it has started executing - or you might not be calling it right at the start of your VI so there is some delay.

 

Oh - setting the panel to hidden should work - there is a difference between closed (no front panel) and hidden (open but not visible) - usually properties which can't be performed on close front panels work on hidden ones. If that still doesn't work - you could try to move the window position offscreen (e.g. -5000, -5000), show it, apply the property and then move it back.


LabVIEW Champion, CLA, CLED, CTD
(blog)
Message 4 of 4
(3,082 Views)