Export (0) Print
Expand All

How to: Use the InputPanel Component 

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

NoteNote

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 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 resizing a TabControl to accommodate the SIP.

The form contains the following controls:

  • A TabControl with two TabPage controls.

  • A TextBox on the first tab page.

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, as 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;


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

Community Additions

ADD
Show:
© 2014 Microsoft