LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Setting winbounds of VI relative to the winbounds of another VI fails in subpanel in exe

Solved!
Go to solution

I have a dialog that I force to appear in the middle of the window of the calling GUI VI using hte WinBounds property of both windows. This works great. Then, I call my GUI VI in a subpanal. Everything works in the development environment. Now, I run this as an executable, and my popum appears centered over the screen origin. It seems the Winbounds property of my subpanel VI is returning the wrong value in this case.  Is that possible?

_____________
Creator of the BundleMagic plugin for LabVIEW!
0 Kudos
Message 1 of 2
(2,970 Views)
Solution
Accepted by topic author littlesphaeroid

I now understand what's going on. A VI in a subpanel doesn't have its own window, it only has a "panel". So window bounds are returned empty for a VI running in a subpanel (I haven't checked the exact form this takes, but this property does not appear to generate an error on read). The calling VI's window could be used, but there doesn't seem to be a way to get a reference to the VI that has the subpanel in it. Instead, we can use the Panel Bounds property once we determine if the VI is running in a subpanel. I have a VI for that already, using this hint:

 

http://digital.ni.com/public.nsf/allkb/FB79ED8B6D07257B86256E93006E31FA

 

It works!

_____________
Creator of the BundleMagic plugin for LabVIEW!
Message 2 of 2
(2,968 Views)