Shoutbox

[SOLVED] Visual Basic Question - MaxWidth... - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Skype & Technology (/forumdisplay.php?fid=9)
+---- Forum: Tech Talk (/forumdisplay.php?fid=17)
+----- Thread: [SOLVED] Visual Basic Question - MaxWidth... (/showthread.php?tid=52512)

[SOLVED] Visual Basic Question - MaxWidth... by DJeX on 11-02-2005 at 02:05 AM

Ok whats the code for the maximum width of the screen and the maximum height of the screen? I tryed MaxWidth and MaxHeight and that didn't seem to work.


RE: Visual Basic Question - MaxWidth... by CookieRevised on 11-02-2005 at 02:12 AM

What do you mean by maximum width/height of the screen?

The actual width/height of the working area (thus desktop minus taskbar)?
=> you need to use some Windows API to get it (SystemParametersInfo API with the constant SPI_GETWORKAREA)

The actual width/height of the desktop screen?
=> Screen.Width, Screen.Height

The actual width/height of a window/form?
=> Form1.Width, Form.Height


---------------

If you are searching for properties of objects, you can simply type an object's name, enter the point, and a dropdown list will be shown with all available properties... scroll that list and look at the names...

Also, check out the properties window of controls. They very clearly show each property of a control.

[Image: attachment.php?pid=503704]


RE: Visual Basic Question - MaxWidth... by dotNorma on 11-02-2005 at 02:25 AM

code:
Private Declare Function SystemParametersInfo Lib "user32" _
    Alias "SystemParametersInfoA" (ByVal uAction As Long, _
    ByVal uParam As Long, ByRef lpvParam As RECT, _
    ByVal fuWinIni As Long) As Long
Private Const SPI_GETWORKAREA = 48


Dim wa_info As RECT
Dim wa_wid As Single
Dim wa_hgt As Single

SystemParametersInfo(SPI_GETWORKAREA, 0, wa_info, 0)


For the work area, but most of this can be found by googling "vb work space" or such.

RE: Visual Basic Question - MaxWidth... by DJeX on 11-02-2005 at 03:31 AM

quote:
Originally posted by CookieRevised
The actual width/height of the desktop screen?
=> Screen.Width, Screen.Height

Thats the one, thanks