|
ScrSize Written by:  Randy Giese Written on:  January 30, 2004 New (August 15, 2008): I added the ability for the user to Hide and UnHide the Menu Bar and the Title Bar.   Left Click on them to Hide them.   Right Click anywhere on the form to UnHide them.   Double Click anywhere on the form to End the program. The purpose of ScrSize is to determine the Size of the usable portion of the screen. The Height can vary for many reasons.   One obvious reason is due to different screen resolutions.   But there are other factors too.   None of this matters if you just set the Window State to Maximized on your form and the actual size doesn't matter.   However, if you have objects that bounce off the screen walls or you need to know when an object leaves the screen, etc. then this program can help. Other reasons that the screen size can vary are: 1) Does the user have the TaskBar always on top or does it Hide when not in use? This will affect the Bottom of the screen (unless the TaskBar is on the Top or one of the sides. 2) Is the form Caption Bar used (with the Minimize & Maximize, etc. buttons)? Depending on whether it is or isn't used, affects the Top and, of course, the Height of the screen. 3) Is there a Menu Bar? This will have an effect similar to the Caption Bar. I wrote ScrSize to address these questions. The menu is only there to take up space so you can see the effect. Next I create a vertical Green bar with a Red border to show the usable screen Height. The Red border is the full height of the usable portion of the screen. There is also a horrizontal Blue bar with a Red border that shows the usable screen Width. The Blue bar is located a little above the information box. The information box displays: The current Screen Resolution. Total Screen Height and Width. The Height of the Title Bar, The Height of the Menu; And the Height or Width of the TaskBar, depending on where it is located, and if it is visible. And finally, the Total Usable Screen Size. All values are shown in Twips and Pixels. But wait, there's more: ScrSize automatically adjusts for screen heights of 480, 600, 768 or 1050. It also instantly re-adjusts if you change the TaskBar. If you move the TaskBar from one edge to another or if you change it's AutoHide feature, the change will be immediately reflected in the ScrSize display. |