Access the answers to your technology questions today.
Subscribe Now
30-day free trial. Register in 60 seconds.
What Makes Experts Exchange Unique?
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.
Try it out and discover for yourself.
Subscribe Now
30-day free trial. Register in 60 seconds.
Join the Community
Give a Little. Get a Lot.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Join the Community
by: Mikal613Posted on 2007-01-16 at 15:35:03ID: 18328737
InputPanel
/en-us/lib rary/ms838 220.aspx
The InputPanel class provides Compact Framework applications information regarding the state of the SIP (the soft keyboard) on the Pocket PC or other embedded devices with a soft keyboard. In addition, the InputPanel class can be used to control the state of the SIP, enabling the application to show or hide the SIP as needed. The methods and properties of the InputPanel class are shown here:
Copy Code
public void InputPanel.InputPanel ( )
public Rectangle InputPanel.Bounds
public Rectangle InputPanel.VisibleDesktop
public bool InputPanel.Enabled
public event EventHandler InputPanel.EnabledChanged
Interestingly, the methods of the InputPanel class are not marked static, so to monitor or control the SIP, the class must first be instantiated. The InputPanel constructor takes no arguments. The InputPanel read-only properties Bounds and VisibleDesktop, both defined as rectangles, provide information about the size and position of the SIP as well as the size of the desktop area not obscured by the SIP.
The VisibleDesktop property provides the rectangle that is the area of the desktop not covered by the SIP. This rectangle changes depending on whether the SIP is displayed or hidden. When the SIP is displayed, the rectangle ranges from just below the navigation bar to just above the top of the SIP window. When the SIP is hidden, the rectangle includes all of the area of the screen below the navigation bar, including the area of the menu bar if one was created by the application.
The Bounds rectangle describes the size and location of the SIP when it's displayed. This rectangle doesn't change if the SIP is hidden. Instead, it always shows the location and size of the SIP as if it were being displayed. Applications wanting to adjust their windows to avoid being covered by the SIP should use the VisibleDesktop property instead of the Bounds property.
The Enabled property is set to true if the SIP is displayed and false if the SIP is hidden. The property is settable, providing the application the ability to show or hide the SIP simply by changing this property.
The InputPanel class contains an event that can be hooked to notify the application when the state of the SIP changes from hidden to shown or shown to hidden. The delegate associated with this event contains only the default object and the EventArgs parameters, so when the event fires, the event handler must query the new state of the SIP using the Enabled parameter.
Working with the SIP
Unless the FormBorderStyle property of the Form class is set to null, the Pocket PC implementation of the runtime overrides the Size and Location properties, preventing an application from resizing a form in response to the SIP being shown or hidden. A workaround for this issue is to create a Panel control or a property sheet on the form and then place all the other controls for the form on that control. An example of using the EnableChanged event can be seen in the IrSquirtCF example later in this chapter. In the example, the EnableChanged event is overridden to adjust the size of the output list box control.
http://msdn2.microsoft.com