PanelMoving Event
PanelMoving Event |
Occurs when the PenInputPanel object is moving.
Declaration
[C++]
HRESULT PanelMoving (
[in, out] long *Left
[in, out] long *Top
);
[Microsoft® Visual Basic® 6.0]
Public Event PanelMoving ( _
Left as Long, _
Top as Long, _
);
Parameters
Left
[in, out] The new horizontal, or x-axis, position of the left edge of the PenInputPanel object, in screen coordinates.
Top
[in, out] The new vertical, or y-axis, position of the left edge of the PenInputPanel object, in screen coordinates.
Remarks
The PanelMoving event is designed to be used to change the position of the pen input panel by changing the Left and Top parameters.
The MoveTo and Refresh methods cause the PenInputPanel object to call its auto-positioning code which triggers a PanelMoving event. Consequently, calling these methods inside a PanelMoving handler can result in a recursive endless loop.
The PanelMoving event is not raised for the Tablet PC Input Panel hover target. It is also not raised when the Input Panel resizes.
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 adds a PanelMoving event handler and a VisibleChanged event handler to thePenInputPanel. In the VisibleChanged handler, the position of the pen input panel is changed, causing the PanelMoving event to fire. Subsequently, the PanelMoving handler sets the text of the attached InkEdit control to a sentence containing the new screen coordinates of the pen input panel.
' 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_PanelMoving(Left As Long, Top As Long)
InkEdit1.Text = "The panel has moved to " + _
Str(thePenInputPanel.Left) + ", " + _
Str(thePenInputPanel.Top)
End Sub
Private Sub thePenInputPanel_VisibleChanged( _
ByVal NewVisibility As Boolean)
' Move the pen input panel to screen position 100, 100
thePenInputPanel.MoveTo 100, 100
End Sub
Applies To
- PenInputPanel Class (Automation Library Reference)