05-04-2012 01:20 PM
This seems like it should have a simple answer, but I can't seem to find it. I have a VI that contains 12 subpanels each within a seperate pane. Each of those subpanels loads a VI. When I resize the main VI, I want all the VIs in the subpanels to resize as well. I've set the subpanel to fit the pane.
I tried programmatically setting the VI front panel bounds to match the subpanel when the main VI's resize event fires. I get an error stating that front panels bounds cannot be set when that VI is in a subpanel.
Any ideas?
05-04-2012 02:10 PM - edited 05-04-2012 02:11 PM
In your resize event, maybe you can unload the subpanel, resize it, then reload on mouse up. It might be disturbing not to see the VI in the subpanel while resizing. Just a thought and there is probably a better way. If there is then someone will definately reply.
05-04-2012 02:27 PM - edited 05-04-2012 02:32 PM
The vi in a subpanel will fire it's own <This VI>: Panel Resize event if the subpanel is resized.
have you tried reacting to the panel resize in each of the loaded VIs?
worth noting: IIRC it doesn't do anything to modify the panel or window bounds of the VI if it's loaded in a subpanel. What you need to do is to read the pane size and origin and fit what's on the subpanel VI FP to that.
05-04-2012 02:54 PM
The answer was even simpiler than I imagined. I just didn't have the option to "scale all object with front panel" (under VI Properties>Window Size) selected in the VIs that I load. Once I did that, they all scaled as expected.
01-18-2013 07:57 AM - edited 01-18-2013 07:58 AM
@blawson wrote:
The vi in a subpanel will fire it's own <This VI>: Panel Resize event if the subpanel is resized.
My tests show this not to be true. Attached is a Parent and Child VI. Run the child and resize the window. You will see the indicator "NewBnds" change as the window is resized. Now run Parent. It will load the Child VI into a sub panel that is set to fit to the pane size. Now if you resize the Parent window, it will resize the subpanel, and the Child Vi will change in size. However the "NewBnds" value does not change, meaning the <This VI : > : Panel Resize event is not being fired in the Child VI, when a subpanel is resized in a Parent VI.
My question is, how do I get notified in the Child VI when a subpanel is resized that the Child has been inserted into?
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
16 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
01-18-2013 02:45 PM
Cross-reply:
http://lavag.org/topic/16483-subpanel-resize-event/#entry100860
If you use the Pane Size events instead, they will fire in the SubPanel VI.