Freigeben über


Height Property [PenInputPanel Class]

Height Property [PenInputPanel Class]

Gets the height of the pen input panel in client coordinates.

Declaration

[C++]

[propget] HRESULT Height (
    [out, retval] long *Height);

[Microsoft® Visual Basic® 6.0]

Public Property Get Height() as Integer

Property Value

long The height of the pen input panel in client coordinates.

This property is read-only.

Return Value

HRESULT value Description
S_OK Success.
E_FAIL An unspecified error occurred.

Remarks

The height of the pen input panel is dependent on the screen resolution for the particular Tablet PC. The panel height is the number of pixels equal to 1.25 inches. The default value at 96 dots per inch (dpi) is 157 pixels. The default value at 120 dpi is 196 pixels. The default value at 133 dpi is 218 pixels.

Starting with Microsoft Windows® XP Tablet PC Edition with Windows XP Service Pack 2 (SP2), the Tablet PC Input Panel allows the user to continue entering handwriting by automatically increasing the size of the Input Panel to accommodate new handwriting. The Height and Width properties do not update to reflect the new size as the Input Panel grows. These properties return the original size of the Input Panel. They also do not report the dimensions of the Input Panel hover target.

Example

[Visual Basic 6.0]

This Visual Basic 6.0 example creates a PenInputPanel object, thePenInputPanel, and attaches it to an InkEdit control, InkEdit1. It then attaches a VisibleChanged event handler, thePenInputPanel_VisibleChanged. In the event handler, it adds a sentence to the content of the edit control to which the PenInputPanel is attached. The sentence states the height of the pen input panel in pixels by retrieving the Height property.

' Declare a new PenInputPanel object
Dim WithEvents thePenInputPanel As PenInputPanel

Private Sub Form_Load()
  ' Create the PenInputPanel
  Set thePenInputPanel = New PenInputPanel

  ' Attach the PenInputPanel to an InkEdit control
  thePenInputPanel.AttachedEditWindow = InkEdit1.hWnd
End Sub

Private Sub thePenInputPanel_VisibleChanged(ByVal NewVisibility As Boolean)
  ' If the panel has become visible...
  If NewVisibility Then
    ' Display the height of the panel in the InkEdit control
     InkEdit1.Text = "The height of the panel is " + _
                     Str(thePenInputPanel.Height) + _
                     " pixels." + CrLf
  End If
End Sub

Applies To