How to: Use the InputPanel Component

The InputPanel component provides programmatic control of the soft input panel (SIP) on a Pocket PC. A typical reason to program the SIP is to reposition or resize controls on the form when the SIP is enabled and disabled.

Note

A MainMenu component is required to use the InputPanel component in the .NET Compact Framework version 1.0.

You can also specify the input method for all input methods that are installed on the Pocket PC. For an example of setting a method, see How to: Set Pocket PC Input Methods.

Example

The following code examples demonstrate how to resize a TabControl to accommodate the SIP.

The form contains the following controls:

When the text box receives the focus, the SIP is enabled for entering text. When a user enables or disables the SIP, the EnabledChanged event is raised. The event handler for this event does the following:

  • If the SIP is enabled, the height of the tab control is decreased so that the SIP does not obscure it.

  • If the SIP is disabled, the height of the tab control is set to the original height, which was stored in a variable when the form was initialized.

'Get the original height of the tab control.
TabOriginalHeight = TabControl1.Height

' Get the deminsions of the visible  
' desktop area when the SIP is not displayed.
VisibleRect = InputPanel1.VisibleDesktop
// Get the original height of the tab control.
TabOriginalHeight = tabControl1.Height;

// Get the deminsions of the visible  
// desktop area when the SIP is not displayed.
VisibleRect = inputPanel1.VisibleDesktop;


inputPanel1.EnabledChanged += new EventHandler(inputPanel1_EnabledChanged);

// Add a delegate for GotFocus event to the TextBox 
// by creating an instance of EventHandler that takes 
// a reference to TextBox1_GotFocus in its argument. 
this.textBox1.GotFocus += new System.EventHandler(this.textBox1_GotFocus);

Compiling the Code

These examples require references to the following namespaces:

See Also

Tasks

How to: Set Pocket PC Input Methods

Concepts

InputPanel Component

Reference

InputPanel