I've been wondering about how to do combine the "fit control to pane" tab control property and the tab control content. Most of my project based on subpanel rather than using tab controls, because positioning the Tab controls content at every panel resize event, is not a good and elegant solution.
Is there any workaround here?
BTW, this community is far the best!
Thank you guys for your good work and thaks for sharing it!
This is not really a workaround, just a demo how we have solves the problem with tabs and resizing "issue". Each tab is a subpanel so resizing is easy to manage.
Message was edited by: Olivier Jourdan
This is a shortcoming yes. I've suggested a change here: http://forums.ni.com/t5/LabVIEW-Idea-Exchange/Fit-to-pane-Fit-to-tab/idi-p/932452
There is a workaround though:
I use two tab controls and splitters to achieve scalability for each page.
The tab controls have the same pages, but one is put in a pane where only its tabs are visible and its change events are transfered to the other tab control which is in a pane below and which does not show its tabs at all, but is set to fit to pane.
The content on the lower tab can then also be set to "fit to pane" and this will make them scale to the whole pane and cover the tab page, but you still have the tab functionality. If you set the border of the splitters OK and align the top path nicely so that its page edge is aligned with the splitter border things will look quite nice.
Here's a commented screen capture of one such app:
Nice workaroud! That would be useful! Thaks!
Anyway is your app. based on STM?
Hello Mads, this is an excellent workarround (easier than mine).
As far as I understand, you are always limited to one object by tab. To be even more scalable, it should be interesting to replace the second tab (where the content is displayed) by a subpanel and insert dynamic VI following the selected tab.
Pro : you can insert splitter in your tab
Cons : it's a bit more complecated to develope
Few weeks ago, I had to develop a tcp/ip server - client app. Before that, I had no expericence about TCP/IP - LV programming. An NI Engineer suggested me the following links:
This is a very useful toolkit for TCP/IP. Take a look at!
You are not limited to one object per tab, but it gets cumbersome if you want more than one of the objects on the page to scale (having buttons etc. together with a single plot (which is the scaling object) e.g is fine.
I've done other apps where I've used subpanels on the second tab. It is a bit more work due to the communication you then typically need to have between the top level VI and the subpanel VIs - so it would definitely be nicer to have better scaling options available instead...(anchoring?), but it does make it possible to produce nice GUIs.
In the past, I have used an Xcontrol to hold multiple controls / splitters - then, used the single xcontrol on the tab. That way, I get the single object, nice scaling, whist having the ability to add fine grain control over which objects scale, which stay the same side, which stick to the top/left/right/bottom etc. It worked very well although takes a bit of effort as you need to make sure you expose enough events / properties / methods to make your xcontrol work for all the functions of the individual controls (my approach was for the xcontrol to generate a user event each time something happened so that the host app's event structure could handle them appropriately). Unfortunately I no longer have access to the source code for that project (as I now work for a different employer).
One important detail when you are setting controls to be scaled/fit to pane on multiple pages of a tab control; you have to finish the settings on each page without ever scaling the pane(!).
If you go to one page, set a control there to scale/fit to pane, then test it before you go to another page and do the same - the previous controls will have lost their scale setting. I do not know if this is a bug, or if it is the other way around; that it is a bug that makes it possible to set multiple controls on different pages to scale. It is kind of strange.