Share via


InputPanel.EnabledChanged Event

Occurs when the soft input panel (SIP) is enabled or disabled.

Namespace: Microsoft.WindowsCE.Forms
Assembly: Microsoft.WindowsCE.Forms (in microsoft.windowsce.forms.dll)

Syntax

'Declaration
Public Event EnabledChanged As EventHandler
'Usage
Dim instance As InputPanel
Dim handler As EventHandler

AddHandler instance.EnabledChanged, handler
public event EventHandler EnabledChanged
public:
event EventHandler^ EnabledChanged {
    void add (EventHandler^ value);
    void remove (EventHandler^ value);
}
/** @event */
public void add_EnabledChanged (EventHandler value)

/** @event */
public void remove_EnabledChanged (EventHandler value)
JScript supports the use of events, but not the declaration of new ones.

Remarks

The EnabledChanged event occurs whenever the SIP is enabled or disabled, either programmatically or by the user. When this event occurs, you can determine whether the SIP is enabled or disabled and reposition or resize controls accordingly.

You can raise this event by changing the Enabled property.

Example

The following code example uses the EnabledChanged event to lower the height of a tab control when the SIP is enabled and returns the tab control to its original height when the SIP is disabled. This code example is part of a larger example provided for the InputPanel component.

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

.NET Framework Security

  • Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see .

Platforms

Windows CE, Windows Mobile for Pocket PC

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

Version Information

.NET Compact Framework

Supported in: 2.0, 1.0

See Also

Reference

InputPanel Class
InputPanel Members
Microsoft.WindowsCE.Forms Namespace
Enabled