Freigeben über


Top Property [PenInputPanel Class]

Top Property [PenInputPanel Class]

Gets the vertical, or y-axis, location of the top edge of the PenInputPanel object, in screen coordinates.

Declaration

[C++]

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

[Microsoft® Visual Basic® 6.0]

Public Property Get Top() as Integer

Property Value

long The vertical, or y-axis, location of the top edge of the PenInputPanel object, in screen coordinates.

This property is read-only.

Return Value

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

Remarks

To explicitly override the automatic positioning behavior of the PenInputPanel object, use the Left and Top properties of the object to determine the current position of the pen input panel. If the pen input panel is located on a section of the screen that should be visible, use the MoveTo method to relocate the pen input panel.

You can also override the automatic positioning behavior of the PenInputPanel object by listening for the Left and Top parameters during a PanelMoving event. If the pen input panel is located on a section of the screen that should be visible, use the MoveTo method to relocate the pen input panel.

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 object is attached. The sentence states the top edge of the PenInputPanel object in pixels by retrieving the Top 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 top edge of the panel in the InkEdit control
    InkEdit1.Text = "The top edge of the panel is at " + _
                    Str(thePenInputPanel.Top) + _
                    " pixels." + CrLf
  End If
End Sub

Applies To