LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to know the "minimum panel size" property

Solved!
Go to solution
I want to know the "Minimum Panel Size" specified in the "VI properties" by programming. It's very important to get this information, because my panel size changes over the execution and I need the minimum panel size available. I can’t use the panel bound property because it return me the actual size of the panel.

Any idea?

Thanks for your help.
0 Kudos
Message 1 of 4
(2,724 Views)
There is no property to directly return the minimum panel size that you set.

You can however trick it into giving it to you. Since you can't use the "Panel Bounds" property to make a window smaller than it's set minimum, You can try to set it to 0,0 size, then read the size and subtract the left from right and top from bottom to get the size. The panel will actually resize to the minimum, but will return an error if you try to go below that.

The attached VI shows this working. I only tried this 7.1, so if you have an earlier version, let me know and I'll save it back.

Ed


Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
Message 2 of 4
(2,700 Views)
As of yet, there is no property to get the minimum size of a panel in LabVIEW, but R&D is aware of the demand for this functionality and is currently working on incorporating it into future releases. For now, the only way I know to get the minimum size of a panel is to do so empirically. If you try to set a panel's size below its minimum size, it will return error 1 (invalid input parameter), so starting at a size of (0,0), you can set the panel size over and over, incrementing an axis by one and clearing error 1, until error 1 is not returned. Once it allows you to resize the panel, you can shrink it by one back to its original size and record the minimum panel size. You'll need to carry this out individually for both axes.

I know it's nowhere near ideal, but if you really need to know the minimum panel size, it's the only way I know of. Best of luck!
E. Sulzer
Applications Engineer
National Instruments
0 Kudos
Message 3 of 4
(2,696 Views)
Solution
Accepted by topic author ERGE
Thanks Ed Dickens and AESulzer for your help.

I made a function that search the minimum panel size property using binary search (LabVIEW 6.1). The function works very well, but the only bug is that affect the display during the search even if I use the "defer panel update" property. Also, we should be very careful by using this function if the "Scale all objects on front panel as the window resizes" property is TRUE.
Message 4 of 4
(2,674 Views)