GUI/Maximum window dimensions: Difference between revisions

From Rosetta Code
< GUI
Content added Content deleted
(→‎Visual Basic: Obvious fix is obvious)
(Mark as draft; needs more work on clarifying the task description)
Line 1: Line 1:
{{task|GUI}}{{requires|Graphics}}
{{draft task|GUI}}{{requires|Graphics}}
The task is to determine the maximum height and width of a window that can fit on the screen without rolling. This is effectively the
The task is to determine the maximum height and width of a window that can fit on the screen without rolling. This is effectively the screen size in pixels minus any adjustments for window decorations and menubars.
screen size in pixels minus any adjustments for window decorations and menubars.


== {{header|Visual Basic}} ==
== {{header|Visual Basic}} ==

Revision as of 09:38, 23 November 2010

GUI/Maximum window dimensions is a draft programming task. It is not yet considered ready to be promoted as a complete task, for reasons that should be found in its talk page.

The task is to determine the maximum height and width of a window that can fit on the screen without rolling. This is effectively the screen size in pixels minus any adjustments for window decorations and menubars.

Visual Basic

<lang vb>TYPE syswindowstru

 screenheight AS INTEGER
 screenwidth AS INTEGER
 maxheight AS INTEGER
 maxwidth AS INTEGER

END TYPE

DIM syswindow AS syswindowstru

' Determine the height and width of the screen

syswindow.screenwidth = Screen.Width / Screen.TwipsPerPixelX syswindow.screenheight=Screen.Height / Screen.TwipsPerPixelY

' Make adjustments for window decorations and menubars</lang>