LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Panel Resize Event does not always get final OldBnds=NewBnds

Solved!
Go to solution

In my application exe built with LV 2019, many display VIs handle the Panel Resize event. I don't want to do the required positioning and resizing of controls for every single resize event, but only for the final one. BUT I have the problem that sometimes a VI gets the final resize event with OldBnds=NewBnds and sometimes it doesn't, for no reason that I can figure out. The LV 2019 Help states: "Because LabVIEW may generate multiple Panel Resize events while you resize the window, LabVIEW generates a final event at the end of the resizing operation in which OldBnds and NewBnds return the same value. You can use the values to identify in the code when the sizing operation finishes." That has always been my expectation, but it doesn't always seem to work. (I also check "Act")

0 Kudos
Message 1 of 4
(2,757 Views)
Solution
Accepted by topic author FermWorks

Have you tried limiting the number of instances the event structure will generate for a resize?

 

Frozen_1-1579128469271.png

---------------------------------------------
Former Certified LabVIEW Developer (CLD)
Message 2 of 4
(2,723 Views)

@FermWorks wrote:

In my application exe built with LV 2019, many display VIs handle the Panel Resize event. I don't want to do the required positioning and resizing of controls for every single resize event, but only for the final one. BUT I have the problem that sometimes a VI gets the final resize event with OldBnds=NewBnds and sometimes it doesn't, for no reason that I can figure out. The LV 2019 Help states: "Because LabVIEW may generate multiple Panel Resize events while you resize the window, LabVIEW generates a final event at the end of the resizing operation in which OldBnds and NewBnds return the same value. You can use the values to identify in the code when the sizing operation finishes." That has always been my expectation, but it doesn't always seem to work. (I also check "Act")


The trick is to only resize if OldBnds==NewBnds.

 

IIRC, OldBnds is always NewBnds when a Panel Resize is 'stable', except with a minimize, maximize.

 

I reuse this library for all my scaling.

Message 3 of 4
(2,674 Views)

Thanks for that tip, Frozen, that helped!

0 Kudos
Message 4 of 4
(2,622 Views)