Share via


PenInputPanel.Top (Propiedad)

Actualización: noviembre 2007

Obsoleto. Obtiene en coordenadas de pantalla el eje vertical o eje Y, que se encuentra en el borde superior del objeto PenInputPanel. PenInputPanel se ha reemplazado por Microsoft.Ink.TextInput.

Espacio de nombres:  Microsoft.Ink
Ensamblado:  Microsoft.Ink (en Microsoft.Ink.dll)

Sintaxis

'Declaración
Public ReadOnly Property Top As Integer
'Uso
Dim instance As PenInputPanel
Dim value As Integer

value = instance.Top
public int Top { get; }
public:
property int Top {
    int get ();
}
/** @property */
public int get_Top()
public function get Top () : int

Valor de propiedad

Tipo: System.Int32
Eje vertical o eje Y, posición del borde superior del objeto PenInputPanel, en coordenadas de la pantalla.

Comentarios

Para invalidar explícitamente el comportamiento de posicionamiento automático del objeto PenInputPanel, use las propiedades Left y Top del objeto para determinar la posición actual del panel de entrada manuscrita.

Para invalidar el comportamiento de posicionamiento automático del objeto PenInputPanel, también puede escuchar a las propiedades Left y Top del objeto PenInputPanelMovingEventArgs durante un evento PanelMoving.

ms571982.alert_security(es-es,VS.90).gifNota de seguridad:

Si se usa en entornos de confianza parcial, esta propiedad 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 crea un objeto PenInputPanel, thePenInputPanel, y se asocia a un control InkEdit, theInkEdit. A continuación, asocia un controlador de eventos VisibleChanged, VisibleChanged_Event. El controlador de eventos usa la propiedad Top para agregar una frase al contenido de theInkEdit, indicando dónde se encuentra el borde superior del objeto PenInputPanel, en coordenadas de la pantalla.

[C#]

//...

// Declare 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 VisibleChanged 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;

        // When the panel has become visible...
        if (e.NewVisibility)
        {
            // Display the top edge of the panel
            // in the attached edit control
            theSenderPanel.AttachedEditControl.Text +=
                    "The top edge of the panel is at ";
            theSenderPanel.AttachedEditControl.Text += theSenderPanel.Top.ToString();
            theSenderPanel.AttachedEditControl.Text += " pixels.\n";
        }
    }
}

En este ejemplo de Microsoft® Visual Basic® .NET se crea un objeto PenInputPanel, thePenInputPanel, y se asocia a un control InkEdit, theInkEdit. A continuación, asocia un controlador de eventos VisibleChanged, VisibleChanged_Event. El controlador de eventos usa la propiedad Top para agregar una frase al contenido de theInkEdit, indicando dónde se encuentra el borde superior del objeto PenInputPanel, en coordenadas de la pantalla.

[Visual Basic]

'...

' Declare the PenInputPanel object
Dim thePenInputPanel As PenInputPanel

Public Sub New()
    MyBase.New()

    ' Required for Windows Form Designer support
    InitializeComponent()

    ' Create and attach the new PenInputPanel to an InkEdit control.
    thePenInputPanel = New PenInputPanel(theInkEdit)

    ' Add a VisibleChanged event handler
    AddHandler thePenInputPanel.VisibleChanged, _
               AddressOf VisibleChanged_Event
End Sub 'New

'...

Public Sub VisibleChanged_Event(ByVal sender As Object, ByVal 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)

        ' When the panel has become visible...
        If e.NewVisibility Then
            ' Display the top edge of the panel
            ' in the attached edit control
            theSenderPanel.AttachedEditControl.Text += _
                     "The top edge of the panel is at "

            theSenderPanel.AttachedEditControl.Text += _
                     theSenderPanel.Top.ToString()

            theSenderPanel.AttachedEditControl.Text += _
                     " pixels." + ControlChars.Lf
        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

Vea también

Referencia

PenInputPanel (Clase)

PenInputPanel (Miembros)

Microsoft.Ink (Espacio de nombres)

PenInputPanel.Left