LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

fp not positioning correctly

I would like my subVIs front panel to be centered (or generally centered) over my main VI. It is just showing the user that the program is cranking while it looks for a connection. However, the subVIs front panel isn't being placed in the proper place on the screen. Am I doing something wrong here? Also, please ignore the awful use of locals (and unclosed references), they will be gone in the near future :). It was just the quickest way to stop right now as I test this.

 

The run time location is set to unchanged in the VI properties.

 

Message Edited by for(imstuck) on 03-30-2010 10:49 AM
0 Kudos
Message 1 of 8
(3,261 Views)

So why do you have the Run-time position set to Unchanged and not to "Centered"?

Anyway, to move the window programmatically use the VI property "Front Panel Window > Window Bounds" or  "Front Panel Window > Panel Bounds"

 

FP-Bounds.png

 

Hope this helps.

 

 

Message Edited by dan_u on 03-30-2010 05:55 PM
0 Kudos
Message 2 of 8
(3,252 Views)

dan_u wrote:

So why do you have the Run-time position set to Unchanged and not to "Centered"?

Anyway, to move the window programmatically use the VI property "Front Panel Window > Window Bounds" or  "Front Panel Window > Panel Bounds"

 

Hope this helps.

 

 


 

Centered puts it centered on the monitor, not over the main VI. That's why I pass in the main VIs coordinates then calculate the center. However, are you sure I have to size it at a specific left right top bottom to place it where I want? I can't just position it?
Message Edited by for(imstuck) on 03-30-2010 10:59 AM
0 Kudos
Message 3 of 8
(3,248 Views)

It's the same property to size and to position the VI. If you just want to move it you will have to add/subtract the same numbers to/from left and right (and the same numbers to/from top and bottom).

Or in other words: Make sure the differences bottom-top and right-left remain unchanged.

 

 

Message 4 of 8
(3,244 Views)

for(imstuck) wrote:

dan_u wrote:

So why do you have the Run-time position set to Unchanged and not to "Centered"?

Anyway, to move the window programmatically use the VI property "Front Panel Window > Window Bounds" or  "Front Panel Window > Panel Bounds"

 

Hope this helps.

 

 


 

Centered puts it centered on the monitor, not over the main VI. That's why I pass in the main VIs coordinates then calculate the center. However, are you sure I have to size it at a specific left right top bottom to place it where I want? I can't just position it?
Message Edited by for(imstuck) on 03-30-2010 10:59 AM

 

I say "center" but my method for calculating, I know, wont position it perfectly over the center. But it will be close enough. I just can't figure why the fp wont move at all...
0 Kudos
Message 5 of 8
(3,243 Views)
K sounds good.
0 Kudos
Message 6 of 8
(3,239 Views)
Check out this idea (And kudo it). Jack shows his code, and I provided a link where I showed my own code to solve this problem. 
--
Tim Elsey
Certified LabVIEW Architect
Message 7 of 8
(3,227 Views)

You need to do a bunch of calculations.  Your method will put the subvi left and top at the middle of the main vi, but the subvi will not be centered.  You need to calcualte the difference in width betweent the two vi's, divide by 2, set the subvi left position to the main left plus the divide by 2 result, set the right to keep the same width as before.... and so on....   See the snipit:

 

SubVICenteredInMain.png

- tbob

Inventor of the WORM Global
Message 8 of 8
(3,226 Views)