PRB: Incorrect Screen Object Width/Height After the Desktop Is Resized (253940)
The information in this article applies to:
- Microsoft Visual Basic Learning Edition for Windows 6.0
- Microsoft Visual Basic Professional Edition for Windows 6.0
- Microsoft Visual Basic Enterprise Edition for Windows 6.0
This article was previously published under Q253940 SYMPTOMS
Inside the Visual Basic IDE, the Screen object reports an incorrect value for the desktop width after the screen resolution is changed.
When the application is executing outside the IDE, the Width and Height properties of the Screen object return incorrect values if the resolution is changed from the Display Properties icon in the System Tray.
RESOLUTION
The GetDeviceCaps API function can be used to return the screen resolution in pixels. This workaround can be examined by removing the comment from the MsgBox command in the code provided in the "More Information" section of this article. The width and height pixel values returned by GetDeviceCaps can be converted to Twips by multiplying by Screen.TwipsPerPixelX and Screen.TwipsPerPixelY, respectively.
Modification Type: | Major | Last Reviewed: | 5/13/2003 |
---|
Keywords: | kbAPI kbGDI kbIDEProject kbprb KB253940 kbAudDeveloper |
---|
|