tags:

views:

54

answers:

1

How do you find out the height of the task tray in vb.net, programmatically?

I created an application which Windows 7 users complain about, because it always overlaps their task tray. I know its 32 px on windows XP, but how do I know how large it is elsewhere?

I am making a winforms app in vb.net 2008.

Thanks!

+1  A: 

You should probably use Screen.PrimaryScreen.WorkingArea to get that. Note that the task bar may not be along the bottom edge of the screen, and the user may also resize it. If you want to detect whether your form is located completely within the working area of the screen, this will do:

If Screen.PrimaryScreen.WorkingArea.Contains(Me.Bounds) Then
    ' the form fits in the working area '
Else
    ' some part of the form is outside the working area '
End If
Fredrik Mörk
It worked! Thanks!
Cyclone
If you want a copy of the project this was for, just ask. Also, can you please help with this one as well? http://stackoverflow.com/questions/1344855/why-does-my-text-keep-highlighting
Cyclone