PenInputPanel.MoveTo (Método)
Actualización: noviembre 2007
Obsoleto. Establece la posición del objeto PenInputPanel en una posición de la pantalla definida. PenInputPanel se ha reemplazado por Microsoft.Ink.TextInput.
Espacio de nombres: Microsoft.Ink
Ensamblado: Microsoft.Ink (en Microsoft.Ink.dll)
Sintaxis
'Declaración
<UIPermissionAttribute(SecurityAction.Demand, Window := UIPermissionWindow.SafeTopLevelWindows)> _
<SecurityPermissionAttribute(SecurityAction.Demand, Unrestricted := True)> _
<PermissionSetAttribute(SecurityAction.InheritanceDemand, Name := "FullTrust")> _
Public Sub MoveTo ( _
left As Integer, _
top As Integer _
)
'Uso
Dim instance As PenInputPanel
Dim left As Integer
Dim top As Integer
instance.MoveTo(left, top)
[UIPermissionAttribute(SecurityAction.Demand, Window = UIPermissionWindow.SafeTopLevelWindows)]
[SecurityPermissionAttribute(SecurityAction.Demand, Unrestricted = true)]
[PermissionSetAttribute(SecurityAction.InheritanceDemand, Name = "FullTrust")]
public void MoveTo(
int left,
int top
)
[UIPermissionAttribute(SecurityAction::Demand, Window = UIPermissionWindow::SafeTopLevelWindows)]
[SecurityPermissionAttribute(SecurityAction::Demand, Unrestricted = true)]
[PermissionSetAttribute(SecurityAction::InheritanceDemand, Name = L"FullTrust")]
public:
void MoveTo(
int left,
int top
)
/** @attribute UIPermissionAttribute(SecurityAction.Demand, Window = UIPermissionWindow.SafeTopLevelWindows) */
/** @attribute SecurityPermissionAttribute(SecurityAction.Demand, Unrestricted = true) */
/** @attribute PermissionSetAttribute(SecurityAction.InheritanceDemand, Name = "FullTrust") */
public void MoveTo(
int left,
int top
)
public function MoveTo(
left : int,
top : int
)
Parámetros
- left
Tipo: System.Int32
Nueva posición del eje X del borde izquierdo del objeto PenInputPanel, en coordenadas de pantalla.
- top
Tipo: System.Int32
Nueva posición del eje Y del borde superior del objeto PenInputPanel, en coordenadas de pantalla.
Comentarios
El método MoveTo produce un error si el control al que se asocia el objeto PenInputPanel no tiene el foco. Se puede llamar a este método sin ningún riesgo si el panel de entrada manuscrita no está visible, con tal de que el control asociado tenga el foco.
Si la nueva posición hace que el panel aparezca fuera del límite del área de trabajo de la pantalla, el panel se desplaza hacia el centro del área de trabajo para que los bordes del mismo sean adyacentes a los bordes más cercanos de la pantalla.
Para invalidar explícitamente el comportamiento de posicionamiento automático del objeto PenInputPanel, use las propiedades Left y Top del objeto PenInputPanel para determinar su posición actual. Si PenInputPanel se encuentra en una sección de la pantalla que debería estar visible, use el método MoveTo para reubicar PenInputPanel.
Para invalidar el comportamiento de posicionamiento automático del objeto PenInputPanel, también puede supervisar las propiedades Left y Top del objeto PenInputPanelMovingEventArgs durante un evento PanelMoving. Si PenInputPanel se encuentra en una sección de la pantalla que debería estar visible, use el método MoveTo para reubicar PenInputPanel.
Nota de seguridad: |
---|
Si se usa en entornos de confianza parcial, este método necesita el permiso SecurityPermissionFlag.AllFlags, además de los permisos que requiere PenInputPanel. Vea Security and Trust para obtener más información. |
Ejemplos
En este ejemplo de C# se asocia un objeto PenInputPanel, thePenInputPanel, a un control InkEdit, theInkEdit. Agrega un controlador de eventos VisibleChanged, VisibleChanged_Event, al formulario de PenInputPanel. En el controlador de eventos, si objeto PenInputPanel está visible, su posición se modifica a las coordenadas de pantalla (100, 100) con una llamada al método MoveTo.
[C#]
//...
// Delcare the PenInputPanel object
PenInputPanel thePenInputPanel;
public Form1()
{
// Required for Windows Form Designer support
InitializeComponent();
// Create and attach the new PenInputPanel to an InkEdit control.
thePenInputPanel = new PenInputPanel(theInkEdit);
// Add a PenInputPanelVisibleChanged event handler
thePenInputPanel.VisibleChanged +=
new PenInputPanelVisibleChangedEventHandler(VisibleChanged_Event);
}
//...
public void VisibleChanged_Event(object sender,
PenInputPanelVisibleChangedEventArgs e)
{
// Make sure the object that generated
// the event is a PenInputPanel object
if (sender is PenInputPanel)
{
PenInputPanel theSenderPanel = (PenInputPanel)sender;
// If the panel has become visible...
if (e.NewVisibility)
{
// Move the pen input panel to
// screen position (100, 100)
theSenderPanel.MoveTo(100, 100);
}
}
}
En este ejemplo de Microsoft® Visual Basic® .NET se asocia un objeto PenInputPanel, thePenInputPanel, a un control InkEdit, theInkEdit. Agrega un controlador de eventos VisibleChanged, VisibleChanged_Event, al formulario de PenInputPanel. En el controlador de eventos, si objeto PenInputPanel está visible, su posición se modifica a las coordenadas de pantalla (100, 100) con una llamada al método MoveTo.
[Visual Basic]
'...
' Declare the PenInputPanel object
Dim thePenInputPanel As PenInputPanel
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
' Create and attach the new PenInputPanel to an InkEdit control.
thePenInputPanel = New PenInputPanel(theInkEdit)
' Add a PenInputPanelVisibleChanged event handler
AddHandler thePenInputPanel.VisibleChanged, _
AddressOf VisibleChanged_Event
End Sub 'New
'...
Public Sub VisibleChanged_Event(sender As Object, e As _
PenInputPanelVisibleChangedEventArgs)
' Make sure the object that generated
' the event is a PenInputPanel object
If TypeOf sender Is PenInputPanel Then
Dim theSenderPanel As PenInputPanel = CType(sender, PenInputPanel)
' If the panel has become visible...
If e.NewVisibility Then
' Move the pen input panel to
' screen position 100, 100
theSenderPanel.MoveTo(100, 100)
End If
End If
End Sub 'VisibleChanged_Event
Plataformas
Windows Vista
.NET Framework y .NET Compact Framework no admiten todas las versiones de cada plataforma. Para obtener una lista de las versiones compatibles, vea Requisitos de sistema de .NET Framework.
Información de versión
.NET Framework
Compatible con: 3.0