InputPanel (Clase)
Actualización: noviembre 2007
Controla el panel de entrada por software (SIP, Soft Input Panel) para escribir datos en dispositivos Pocket PC y otros dispositivos basados en Windows Embedded CE.
Espacio de nombres: Microsoft.WindowsCE.Forms
Ensamblado: Microsoft.WindowsCE.Forms (en Microsoft.WindowsCE.Forms.dll)
Sintaxis
'Declaración
Public Class InputPanel _
Inherits Component
'Uso
Dim instance As InputPanel
public class InputPanel : Component
public ref class InputPanel : public Component
public class InputPanel extends Component
Comentarios
.NET Compact Framework proporciona el componente InputPanel, que facilita una implementación administrada del control SIP en Windows Embedded CE. Cuando se crea una aplicación basada en Windows destinada a la plataforma Pocket PC, Visual Studio agrega automáticamente un componente MainMenu al archivo Form1 del proyecto. Este componente agrega la barra de menús inferior con el icono SIP al formulario. Para utilizar el SIP no es necesaria ninguna programación; los usuarios pueden alternar la presentación del SIP punteando en el icono. Para programar el SIP, arrastre el componente InputPanel desde el ToolBox al formulario.
Puede mostrar el SIP mediante programación utilizando la propiedad Enabled, obtener su tamaño utilizando la propiedad Bounds y determinar el tamaño del área de formulario que no está ocupada por el SIP utilizando la propiedad VisibleDesktop. Tenga en cuenta que la propiedad Bounds siempre devuelve un ancho de 240 píxeles y un alto de 80 píxeles para dispositivos Pocket PC, independientemente de que el SIP esté habilitado. El evento EnabledChanged se produce siempre que se habilita o se deshabilita SIP, ya sea por parte del usuario o mediante programación. Una razón típica para programar el SIP es cambiar la posición o el tamaño de los controles del formulario al habilitar y deshabilitar el SIP.
Topic | Location |
---|---|
Cómo: Utilizar el componente InputPanel | .NET Compact Framework |
Cómo: Utilizar el componente InputPanel | .NET Compact Framework |
Cómo: Utilizar el componente InputPanel | .NET Compact Framework |
Ejemplos
El ejemplo siguiente contiene un cuadro de texto en una página de un control de ficha. Muestra el SIP cuando el cuadro de texto recibe el foco, y utiliza el evento EnabledChanged para reducir el alto del control de ficha cuando se habilita el SIP y restaurar el alto original cuando se deshabilita el SIP.
Nota
Para poder generar este ejemplo, debe agregar una referencia al espacio de nombres Microsoft.WindowsCE.Forms en el proyecto.
Private Sub TextBox1_GotFocus(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles TextBox1.GotFocus
' Display the SIP.
' Note that the EnabledChanged event occurs
' whenever the SIP is enabled or disabled.
InputPanel1.Enabled = True
End Sub
Private Sub InputPanel1_EnabledChanged(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles InputPanel1.EnabledChanged
If InputPanel1.Enabled = False Then
' The SIP is disabled, so set the height of the tab control
' to its original height with a variable (TabOriginalHeight),
' which is determined during initialization of the form.
VisibleRect = InputPanel1.VisibleDesktop
TabControl1.Height = TabOriginalHeight
Else
' The SIP is enabled, so the height of the tab control
' is set to the height of the visible desktop area.
VisibleRect = InputPanel1.VisibleDesktop
TabControl1.Height = VisibleRect.Height
End If
' The Bounds property always returns a width of 240 and a height of 80
' pixels for Pocket PCs, regardless of whether or not the SIP is enabled.
BoundsRect = InputPanel1.Bounds
' Show the VisibleDesktop and Bounds values
' on the second tab for demonstration purposes.
VisibleInfo.Text = String.Format("VisibleDesktop: X = {0}, " _
& "Y = {1}, Width = {2}, Height = {3}", _
VisibleRect.X, VisibleRect.Y, _
VisibleRect.Width, VisibleRect.Height)
BoundsInfo.Text = String.Format("Bounds: X = {0}, Y = {1}," _
& "Width = {2}, Height = {3}", BoundsRect.X, BoundsRect.Y, _
BoundsRect.Width, BoundsRect.Height)
End Sub
private void textBox1_GotFocus(object sender, System.EventArgs e)
{
// Display the SIP.
// Note that the EnabledChanged event occurs
// whenever the SIP is enabled or disabled.
inputPanel1.Enabled = true;
}
private void inputPanel1_EnabledChanged(object sender, EventArgs e)
{
if (inputPanel1.Enabled == false)
{
// The SIP is disabled, so set the height of the tab control
// to its original height with a variable (TabOriginalHeight),
// which is determined during initialization of the form.
VisibleRect = inputPanel1.VisibleDesktop;
tabControl1.Height = TabOriginalHeight;
}
else
{
// The SIP is enabled, so the height of the tab control
// is set to the height of the visible desktop area.
VisibleRect = inputPanel1.VisibleDesktop;
tabControl1.Height = VisibleRect.Height;
}
// The Bounds property always returns a width of 240 and a height of 80
// pixels for Pocket PCs, regardless of whether or not the SIP is enabled.
BoundsRect = inputPanel1.Bounds;
// Show the VisibleDestkop and Bounds values
// on the second tab for demonstration purposes.
VisibleInfo.Text = String.Format("VisibleDesktop: X = {0}, " +
"Y = {1}, Width = {2}, Height = {3}", VisibleRect.X,
VisibleRect.Y, VisibleRect.Width, VisibleRect.Height);
BoundsInfo.Text = String.Format("Bounds: X = {0}, Y = {1}, " +
"Width = {2}, Height = {3}", BoundsRect.X, BoundsRect.Y,
BoundsRect.Width, BoundsRect.Height);
}
Jerarquía de herencia
System.Object
System.MarshalByRefObject
System.ComponentModel.Component
Microsoft.WindowsCE.Forms.InputPanel
Seguridad para subprocesos
Todos los miembros static (Shared en Visual Basic) públicos de este tipo son seguros para la ejecución de subprocesos. No se garantiza que los miembros de instancias sean seguros para la ejecución de subprocesos.
Plataformas
Windows CE, Windows Mobile para Pocket PC
.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 Compact Framework
Compatible con: 3.5, 2.0, 1.0