01-15-2020 03:45 PM
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")
Solved! Go to Solution.
01-15-2020 04:48 PM
Have you tried limiting the number of instances the event structure will generate for a resize?
01-16-2020 03:03 AM - edited 01-16-2020 03:04 AM
@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.
01-16-2020 02:24 PM - edited 01-16-2020 02:25 PM
Thanks for that tip, Frozen, that helped!