can someone just double-check my code? cuz it seems to be working almost fine except its one pixel off for some reason
VB Code:
  1. Public ReadOnly Property TitleBarHeight(ByVal bStyle As FormBorderStyle) As Integer
  2.         Get
  3.            Select Case bStyle
  4.                 Case FormBorderStyle.Fixed3D
  5.                     Return SystemInformation.CaptionHeight + _
  6.                                   2 * SystemInformation.Border3DSize.Height
  7.  
  8.  
  9.                 Case FormBorderStyle.Sizable, FormBorderStyle.FixedSingle, FormBorderStyle.FixedDialog
  10.                     Return SystemInformation.CaptionHeight + _
  11.                              2 * SystemInformation.Border3DSize.Height
  12.  
  13.  
  14.  
  15.                 Case FormBorderStyle.FixedToolWindow, FormBorderStyle.SizableToolWindow
  16.                     Return SystemInformation.ToolWindowCaptionHeight + _
  17.                              2 * SystemInformation.Border3DSize.Height
  18.  
  19.                 Case FormBorderStyle.None
  20.                     Return 0
  21.             End Select
  22.         End Get
  23.     End Property
The first case switch returns a value 1 pixel less than the actual value, and the second case statement returns 1 pixel more than the actual value. I think I'm using the right stuff, why isn't it working correctly?