Jump to content

What determines which monitor a dialog shows on?

Recommended Posts

I have an application where the "second monitor" of the Windows computer is actually a projector, used in running a test.  I display test patterns on this monitor, but the User can't see them.  The problem I am having is ensuring that all dialog boxes, including error dialogs, show up on the primary screen always.  But, intermittently, they start to show up on the projector.   I cannot seem to discover how Windows/LabVIEW decides which monitor to show dialogs on.   Does anyone know?  

Link to comment

I also was a bit frustrated by this some times.  So attached is a demo of some panel movement code.  It has a few main functions. 

The first is sometimes I'd have a dialog I wanted to pop up, but I wanted it to be centered on whatever monitor the mouse was on.  My thought was that this was the monitor the user was using, and they probably just clicked something, so put it there. 

I also had times that I would pop up a dialog under the mouse and so I wanted the panel to be centered on the mouse as best it can, but stay on the same monitor.  This doesn't always work well with taskbars that can be hidden, and size and position not being consistent but it mostly works.

And lastly I sometimes had a need to set a panel to maximize on a specific monitor.  We typically would have 2 or 3 set side by side in the system.  So this VI can set a panel to maximize on the "Primary", "Left", "Right", "Second from Left" or a few others.

As you noticed this won't fix LabVIEW native dialogs, and any solution I can think of for those will be a bit hacky.

Panel Movement Center Maximize Demo.zip

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

By using this site, you agree to our Terms of Use.