Compartir a través de


InputPanel Class

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Controls the soft input panel (SIP) for entering data on Pocket PCs and other Windows Embedded CE-based devices. 

Namespace:  Microsoft.WindowsCE.Forms
Assembly:  Microsoft.WindowsCE.Forms (in Microsoft.WindowsCE.Forms.dll)

Syntax

'Declaration
Public Class InputPanel _
    Inherits Component
'Usage
Dim instance As InputPanel
public class InputPanel : Component
public ref class InputPanel : public Component
type InputPanel =  
    class
        inherit Component
    end

Remarks

The .NET Compact Framework provides the InputPanel component, which supplies a managed implementation of the SIP control in Windows Embedded CE. When you create a Windows-based application that targets the Pocket PC platform, Visual Studio automatically adds a MainMenu component to the Form1 file in your project. This component adds the lower menu bar with the SIP icon to your form. No programming is required to use the SIP; users can toggle the display of the SIP by tapping the icon. To program the SIP, drag the InputPanel component from the ToolBox to your form.

You can show the SIP programmatically by using the Enabled property, get its size by using the Bounds property, and determine the size of the form area that is not occupied by the SIP by using the VisibleDesktop property. Note that the Bounds property always returns a width of 240 pixels and a height of 80 pixels for Pocket PCs, regardless of whether the SIP is enabled. The EnabledChanged event occurs whenever the SIP is enabled or disabled, either by the user or programmatically. A typical reason for programming the SIP is to reposition or resize controls on the form when the SIP is enabled and disabled.

Note

A few Pocket PC devices return a height greater than 80 pixels for the SIP. Use the Bounds property to determine the height.

Topic Location
How to: Use the InputPanel Component .NET Compact Framework
How to: Use the InputPanel Component .NET Compact Framework
How to: Use the InputPanel Component .NET Compact Framework

Examples

The following example contains a text box on a page of a tab control. It displays the SIP when the text box receives the focus, and uses the EnabledChanged event to decrease the height of the tab control when the SIP is enabled and restore its original height when the SIP is disabled.

Note

You must add a reference to the Microsoft.WindowsCE.Forms namespace to your project to build this example.

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);
}

Inheritance Hierarchy

System.Object
  System.MarshalByRefObject
    System.ComponentModel.Component
      Microsoft.WindowsCE.Forms.InputPanel

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Windows CE, Windows Mobile for Pocket PC

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Version Information

.NET Compact Framework

Supported in: 3.5, 2.0, 1.0

See Also

Reference

InputPanel Members

Microsoft.WindowsCE.Forms Namespace