Jump to content

Fit Control to Tab Page (similar to Fit Control to Pane)


Jim Kring

Recommended Posts

I have a Tab Control with several pages. Each page has one and only one control/indicator. I would like to configure each tab, such that the one control/indicator on it takes up the entire page area of the tab.

For example, I have the Tab Control on a VI's pane, and the tab control is set to Fit Control to Pane. As the pane resizes, so does the Tab Control (and therefore its pages resize). I want the control on each page of the tab to also resize, so that it always fits the entire page area as the Tab Control resizes. A Fit Control to Tab Page option might do the trick.

post-17-1194817930.png?width=400

Link to comment

QUOTE(Norm Kirchner @ Nov 12 2007, 07:59 AM)

I've encountered this more than a few times and ended up making a Brat VI to handle the management of this. I would much rather have the "control resize to tab" be integrated into the environment.

Hey Norm,

Is your VI very general purpose? Want to make it general purpose? Need help? I'll probably end up implementing this for myself and if you've already got a head start, I would be happy to add my contributions/improvements and post them to LAVA as a BSD licensed VI.

Thanks,

-Jim

Link to comment

QUOTE(PJM_labview @ Nov 12 2007, 07:13 PM)

Incorrect answer. I start with a regular TAB size. The TAB resizing happens behind the scene.

Resize the TAB and see for yourself.

PJM

Sorry, I think I get what you did (LaVIEW just crashed on me) You've set the control to 'size with pane', thus making the table follow, But I don't know how it goes for other tab-pages.

Ton

Link to comment

QUOTE(Norm Kirchner @ Nov 12 2007, 07:59 AM)

Amen to that! Now we all need to flood the http://digital.ni.com/applications/psc.nsf/default?OpenForm' target="_blank">NI wish list page.Quick, before Aristos find out!

Edit\correction Well, now that I experimented more with PJM's solution, it seems that we already have this feature. Cool!

Link to comment

QUOTE(Michael_Aivaliotis @ Nov 12 2007, 12:33 PM)

Edit\correction Well, now that I experimented more with PJM's solution, it seems that we already have this feature. Cool!

Not really, I've played around with it inside of panes and it doesn't always work as expected. However, I'm testing in 8.2. Maybe this is fixed in 8.5.

Link to comment

QUOTE(Jim Kring @ Nov 12 2007, 11:24 AM)

Hey Norm,

Is your VI very general purpose? Want to make it general purpose? Need help? I'll probably end up implementing this for myself and if you've already got a head start, I would be happy to add my contributions/improvements and post them to LAVA as a BSD licensed VI.

Just nosed into my code, and realized that there is no direct way to do this because of the lack of a single "writeable" property that can change size.

Has OpenG created a tool that will allow for a single input of a class reference and a size and it will correctly call the property to resize the object?

~,~

Link to comment

QUOTE(Norm Kirchner @ Nov 12 2007, 01:12 PM)

Just nosed into my code, and realized that there is no direct way to do this because of the lack of a single "writeable" property that can change size.

Has OpenG created a tool that will allow for a single input of a class reference and a size and it will correctly call the property to resize the object?

~,~

I noticed this too. Unfortunately, even when different control types implement Size, it appears that they do not inherit it. So, there is no generic "Size" property. We'll have to create a type-check>>down-cast>>size-setter VI -- and, this doesn't exist.

-Jim

Link to comment

QUOTE(Norm Kirchner @ Nov 13 2007, 12:59 AM)

Done. The VI I posted http://forums.ni.com/ni/board/message?board.id=170&view=by_date_ascending&message.id=271190#M271190' target="_blank">here should resize any resizable control. What do I win?

Of course, the problem with it is that it works the same as the manual resizing, so that there some things that you can't do with it (like resizing a numeric control vertically). There is some more info on this issue in that thread.

Link to comment

QUOTE(Yen @ Nov 13 2007, 12:32 PM)

Done. The VI I posted here should resize any resizable control. What do I win?Of course, the problem with it is that it works the same as the manual resizing, so that there some things that you can't do with it (like resizing a numeric control vertically). There is some more info on this issue in that thread.
Making the Library path in the configuration read LabVIEW instead of LabVIEW.exe would help immensely to make this VI run on any LabVIEW platform :rolleyes: And I have a somewhat more useful version of this I think.

CTRL Size Front Panel Object.vi

QUOTE(Norm Kirchner @ Nov 13 2007, 04:10 PM)

Actually, NI beat you to it. I have to say that I'm flabbergasted that NI has had this available and never wrapped it up for us, nor have I seen anyone else wrap it up.Is it dangerous to use?

It's used deep in some of the tools that LabVIEW comes with since quite some versions that are really just LabVIEW VIs too. I haven't found it to be dangerous and it does actually have some very nice features such as resizing list boxes even vertically on pixel level, something you couldn't do in LabVIEW 7.x with other properties (the only way that allowed resizing the height of list boxes was through number of lines and calculating that based on pixel size changes of the window was a pain in the a__.

Some of my application use this to create a real autosizing of some of the UIs when the user resizes the window.

Rolf Kalbermatter

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.