LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Display full size of a panel (cvi 6)

Hello,

My panel has a title bar and a menu bar , I want to display it just as my screen size ,this means it shows in a full screen size without pressing the maximizing button .Which function or method can be used to realize this ? Thanks.

David
0 Kudos
Message 1 of 8
(3,898 Views)
You can use the following function call: SetPanelAttribute (panelHandle, ATTR_WINDOW_ZOOM, VAL_MAXIMIZE);
For more details please see the User Interface Library Reference Manual or CVI's function panel help.
Regards,
Heinrich Illig
National Instruments
0 Kudos
Message 2 of 8
(3,898 Views)
To programmatically maximize your panel,
SetPanelAttribute (panelHandle, ATTR_WINDOW_ZOOM, VAL_MAXIMIZE);
where panelHandle is the value returned from LoadPanel().
To set the panel size to full screen (without maximizing it), call GetMonitorAttribute() to get the monitor's height, width, top and left, then call SetPanelAttribute() to set the panel's attributes to the same values read from the monitor.
0 Kudos
Message 3 of 8
(3,898 Views)
Hi AIS,

Because the TOP ,LEFT ... properties are just the position that the "panel" relative to the origin of the secreen , which does not include the panel's title bar ,so as your prompt it can not meet my requirement.

I do not want to use the maximum button . I just want to show a window as the screen size , and the maximum button is on a normal state . Thanks.

David
0 Kudos
Message 4 of 8
(3,898 Views)
Sure: just fudge it a little bit based on the TOP of a panel at the top of the screen. Look at the attached example which executes this code:
GetMonitorFromPanel (panelHandle, &monitorID);
GetMonitorAttribute (monitorID, ATTR_HEIGHT, &monitorHeight);
GetMonitorAttribute (monitorID, ATTR_WIDTH, &monitorWidth);
SetPanelAttribute (panelHandle, ATTR_HEIGHT, monitorHeight-21);
SetPanelAttribute (panelHandle, ATTR_WIDTH, monitorWidth-1);
SetPanelAttribute (panelHandle, ATTR_TOP, 21);
SetPanelAttribute (panelHandle, ATTR_LEFT, 1);
0 Kudos
Message 5 of 8
(3,898 Views)
Thank you , AIS ! To the constant( 21 and 1) in SetPanelAttribute() ,would you please advise me the detail ?

David
0 Kudos
Message 6 of 8
(3,898 Views)
I created a new panel, which by default was placed in the upper left-hand corner of the screen. I called GetPanelAttribute() to find the top of that panel, and saw it was 21. I set the left to 1 because at 0 the left border of the window wasn't displayed.
Don't be afraid to experiment to find something that works the way you want it. Trial and error is a valid experimental method.
0 Kudos
Message 7 of 8
(3,898 Views)
Thank You Very Much !

David
0 Kudos
Message 8 of 8
(3,898 Views)