Left Property [PenInputPanel Class]
Left Property [PenInputPanel Class] |
Gets the horizontal, or x-axis, location of the left edge of the PenInputPanel object, in screen coordinates.
Declaration
[C++]
[propget] HRESULT Left (
[out, retval] long *Left);
[Microsoft® Visual Basic® 6.0]
Public Property Get Left() as Integer
Property Value
long The horizontal, or x-axis, location of the left 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 left edge of the PenInputPanel object in pixels by retrieving the Left 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 left edge of the panel in the InkEdit control
InkEdit1.Text = "The left edge of the panel is at " + _
Str(thePenInputPanel.Left) + _
" pixels." + CrLf
End If
End Sub