LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do i set tab control page size programmatically?

Hi,

I have a tab control in my program and each page has different amounts of controls on it. I would like to know how I can make the tab control pages resize automatically, only to fit the controls on the page and not have extra space underneath that other pages require.
0 Kudos
Message 1 of 3
(3,943 Views)
Romulus,

Here is a method you can use to change the size. I made it generic so it will programatically figure out the size of the tabs. You may want to build up a lookup table of sizes rather than doing all these calculations. It just depends on how often you plan on changing th elocation of th controls, and how generic you want the VI to be.

Let me know if you have any questions.
Message 2 of 3
(3,943 Views)
romulus wrote in message news:<506500000008000000CFFE0000-1079395200000@exchange.ni.com>...
> Hi,
>
> I have a tab control in my program and each page has different amounts
> of controls on it. I would like to know how I can make the tab control
> pages resize automatically, only to fit the controls on the page and
> not have extra space underneath that other pages require.

You can use the tab control property 'PaneDimension' to
programatically change the size of the tab control. To
programatically find the areas occupied by the controls on each page:
Use the 'Pages' property of the tab control to get a reference to the
desired page; wire that to a property node and select the
'ControlsOnPage[]' property; iterate through all the control
refere
nces, getting the position and bounds of each control, using
'Max & Min' and shift registers to find the extent occupied by the
controls.

Paul Cardinale
Message 3 of 3
(3,943 Views)