LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I keep a VI in the background window focus?

I have a situation where a main VI plots data in two sub VI's windows. Every time the data is updated, the
two windows with charts in them grab window focus in rapid succession. If they're overlapping, there's a lot
of flickering as they fight to stay on top.

How can I force window focus to stay on the main VI? Or, how can I have window focus controlled by the mouse,
and not by LabView? Thanks!
0 Kudos
Message 1 of 2
(4,331 Views)
Have you tried making the main VI modal? I believe that this should force it to stay on top.

- From the front panel, right click on the vi's icon in the top right of your screen
- Select VI Properties...
- In the Category drop down box, select Window Appearance
- Click Customize... button
- Change Window Behaviour to Modal.
- Click OK
- Click OK
- Save your VI

If you want to do this programmatically, you will need to download lvwutil32.dll I can never find this on ni's website, but Google will find it in several places for you.

Richard

From Labview Help:
Window Behavior—Sets the behavior of the front panel window. You also can use the Front Panel Window:Behavior property to set the behavior programmatically.
Default—Resets the front panel to its default behavior so it does not behave as a floating or modal window.
Floating—Keeps the front panel on top of all other non-floating LabVIEW windows. Windows and Mac OS If multiple floating windows are open, the last one whose title bar you click appears on top.
Hide when LabVIEW is not active—Configures the front panel so when you switch from LabVIEW to another application or when a modal LabVIEW window appears, the window does not appear.

Note If you place a checkmark in the Allow user to minimize window checkbox, select the Floating option, and place a checkmark in the Hide when LabVIEW is not active checkbox, the front panel window might not behave as expected. For example, on Windows, if you cannot minimize a window, it does not appear in the taskbar. Windows that hide when the application does not have focus also hide their icons in the taskbar. The appearance and disappearance of an item in the taskbar each time the focus changes between LabVIEW and another application can be distracting to the user.

Modal—Keeps the front panel on top of all other LabVIEW windows until you close the window or open another modal window. You cannot interact with other windows while a modal window is open. Most dialog boxes in LabVIEW are modal windows, such as the Options dialog box.
Message 2 of 2
(4,325 Views)