11-26-2018 07:55 AM
The code is not really needed, as everything done is "playing" with the VI properties.
11-26-2018 07:58 AM
My apologies, too much Turkey has fried my brain. Others have, indeed, mentioned that this can easily be done during Development by adjusting the VI Properties before building the Executable. I also must confess that I tested this in LabVIEW 2016, not yet in LabVIEW 2018 ...
Bob "Oops" Schor
11-26-2018 09:22 AM
So in short (please confirm or give steps to reproduce):
+ hide toolbar and\or menu in VI properties
+ run the VI
>LV18 won't hide them
+ Resize the VI
>LV18 will hide them
11-26-2018 09:35 AM
The easy way to do this is to go to VI Properties --> Windows Appearance and select the "Dialog" radio button. This should set up the appearance exactly how you need it. If not, you can select the "Customize" radio button. This gives you the option to customize the current appearance of your VI. Since "Dialog" is the current appearance, that's how the customize menu will be set up. It's probably easier to set it up as "Dialog" and customize that than it is to customize the "Default" setting and forget something.
11-26-2018 09:38 AM
I have just made a little test vi that does exactly as you describe. In VI properties I removed (hidden) the menu bar and the tool bar, and set the minimum panel size to 400x400.
When the VI runs, it still displays the menu bar and tool bar, but when resized it dissapears and stays away even when minimized. That has got to be a bug.
In my main VI, I have developed the UI to fit a resolution of 1024x768. But should it be displayed in maximized mode on a larger resolution it looks bad, why I just wants it to be centered. So how do I make sure that the menu bar and toolbar (or the space allocated for it) always will stay away?
11-26-2018 09:45 AM
Observation:
If the test VI is in minimized mode before running it, the toolbar and menu bar stays. If the test vi is maximized before running, the toolbar and menu bar is away as wanted. Why?
11-26-2018 10:10 AM
I think this is related to the "Minimum Panel Size" and the current panel size. When your panel is at the minimum panel size and then you run, the window needs to shrink to remove the menu and toolbar. But this will make the panel size smaller than the minimum and I think it is erroring out and being ignored by the innerds of the generated code. Just barely resize your panel to be slightly larger than the minimum (in either direction), and the issue seems to go away.
Yes, I say this is a bug. But there is at least a simple work around.
And I just confirmed the same issue in 2016. But it works just fine in 8.2 (I don't have any versions between those two available to try).
11-26-2018 10:18 AM
Something seems corrupted with that specific VI.
I see the behavior you are describing when I run it. But if I make the VI slightly larger than the minimum size, like 401 x 401, it doesn't give the extra space.
I created a new VI and modeled it after yours, I didn't see a problem at all.
11-26-2018 10:28 AM
@RavensFan wrote:
I created a new VI and modeled it after yours, I didn't see a problem at all.
Really? I got it immediately with a new VI in 2016 (attached).
11-26-2018 10:46 AM
@crossrulz wrote:
@RavensFan wrote:
I created a new VI and modeled it after yours, I didn't see a problem at all.
Really? I got it immediately with a new VI in 2016 (attached).
I created from scratch in 2018.