07-12-2010 03:03 PM
Hello!
I'm working on a software which calls different sub-VIs and they all open as new windows in front of the main one. The problem is that those windows are usually smaller than the parent VI and sometimes the amount of controls you see on the screen is a little annoying. You would see the parent VI on the area which the new window doesn't covers. What I would like to do is to have the parent VI change it's brightness or maybe have some "fog effect" on it in such a way that what calls your attention is the currently active VI. Please apologize for the confusing explanation, but I'm not sure how to make myself "understandable". I found an article explaining how to change the background color of the VI, however, I have an image as the background of the application, so the color change would have no effect. What I want is something similar to what happens when Windows Vista asks you for administrative rights to proceed with some action, when all the remaining screen gets darker and that brings your attention to the dialog box.
Thanks in advance for the help!
Regards,
Giovanni
Solved! Go to Solution.
07-12-2010 03:11 PM
You can use the Front Panel Window - Transparency property node to set the transparencies of the windows not in focus to a more transparent value.
07-12-2010 03:19 PM
See the attached VI.
07-13-2010 02:44 AM
Here's one I did a long time ago, but never actually used. A quick test in LV 2009 shows it doesn't show the fading in and out effect it was supposed to, but I'll let you figure that one out in the code if you want. As the others mentioned, you can now probably replace the transparency subVIs with the built-in property.
07-13-2010 03:46 AM
Together with using the transparancy control of the main VI, if you make the "Window appearance" property of sub-VI as "Modal", it will always stay on top of the caller VI. See examples attached.
07-13-2010 01:45 PM
Hello!
First of all, thanks a lot for your prompt assistance. Unfortunately, I'm running LabVIEW 7, so I could not find the built-in transparence function. I've checked tst's library and used his transparence sub-VI on the inactive window whenever a new window is opened.
I did some changes to it adding comments from my researches on MSDN regarding the functions used, so in case anyone finds it helpul, here's the VI.
I appreciate everyone's contribution.
Giovanni Pace
07-14-2010 01:46 AM
The transparency property works perfectly fine in Windows 7. It can be found at VI.Front Panel Window>>Transparency, but you should note there's another boolean property there which you need to set to T if you want it to actually work. Also, its scale is 100-0 as opposed to the 0-255 you currently have. I would say it's better to use it because it's built in and should work on all platforms.
I can say that the Windows function has one nice advantage in that you can use it to set one color in a window completely transparent, thus creating a hole in the window (which you can click through to what's under the window. This allows creating shaped windows fairly easily.
Also, that demo was written as a test. As you can see it's messy and it has code which was placed there to work around display issues in older LV versions. If you're going to use it, I would suggest cleaning and debugging it (and then maybe uploading the updated code).