From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

resize panel with Tab containing buttons and a listbox

hi all,

 

I use Labview 2011.I want to let the user resize the left panel by moving the splitter without resizing the buttons in the page 1 of the TAB, but the list box in the page 2 has to fit the left panel. In the attached VI, you see that if you move the splitter to the minimum position then you increase the panel size, the position of the buttons changes. how to solve that ?

 

thank you

 

Cedric

0 Kudos
Message 1 of 8
(2,814 Views)

Well I can tell you why this is happening but I don't know a good solution.

 

You set the listbox to fit to the pane.  This means as the pane resizes, it will scale the control to fit to it.  Then you show the tab that the listbox is not on.  Now when a resize happens, LabVIEW does its best to make sure that the listbox fits to the pane size scaling things as it sees fit.  The problem is that the listbox isn't being shown any more and LabVIEW's attempt to keep it fitting to the UI causes other controls to be pushed around.  Normally this isn't a problem because the Listbox is the only control that LabVIEW is conserned with.  But in this case the control isn't being shown.

 

I tried a few things, but nothing short of moving the buttons after showing the tab worked in all situations.

0 Kudos
Message 2 of 8
(2,783 Views)

A possibility is to reposition the controls when you move the splitter. I would also suggest to fix a minimum width for the pane that contain the Tab control.

 

Ben64

0 Kudos
Message 3 of 8
(2,777 Views)

thank you bean64 for the suggestions. I implemented the one to reposition the controls when the window is resized but as you can see on the attached VI, if you resize vertically the window, you can visually see that first the controls move to another position (because of the new window size) and THEN the controls are reposition at the specified position. how to avoid this visual effect?

 

Cedric 

0 Kudos
Message 4 of 8
(2,752 Views)

Defer Panel Updates might be what you are looking for:

 

http://zone.ni.com/reference/en-XX/help/371361H-01/lvprop/pnl_defer_pnl_updts/

 

Usually it is used when you have many things on the UI you want to update at once.  You defer the updates, change all the UI elements you want, and then un-defer them so all the changes can be seen.  You could defer before the first movement, and then un-defer after the second so to the user you should only see one movement.

0 Kudos
Message 5 of 8
(2,744 Views)

thanks Hooovahh for the suggestion but how to implemente it in my case since the front panel is resized before getting the 'Panel resize' event. any suggestions?

 

Cedric 

0 Kudos
Message 6 of 8
(2,738 Views)

Hi Cedric,

 

I tried working with the VI a bit, but it looks like you're right. Since the front panel is resized before you get the "Panel Resize" event, you can't Defer Panel Updates before LabVIEW moves the buttons. You would need to catch it before the LabVIEW calculates where to move the buttons.

 

I'm sorry I don't have a more helpful solution. I can look into this further, but for now I don't see a way to get past the button flicker when you resize the window.

 

Good luck on your application!

Emily C
Applications Engineer
National Instruments
0 Kudos
Message 7 of 8
(2,705 Views)

What's missing is the panel sizing event.  But we only have panel sized event.

With Windows API, you can catch panel sizing event.

 

Or you can move buttons out of the tab control.  Make them floating on top of the tab.

Only visible for the right tab page.

Put buttons in a cluster to reduce the use of property node.

 

 

George Zou
0 Kudos
Message 8 of 8
(2,692 Views)