07-13-2016 06:00 PM
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?
Solved! Go to Solution.
07-13-2016 06:16 PM - edited 07-13-2016 06:31 PM
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!