Partager via


InputPanel.EnabledChanged, événement

Mise à jour : novembre 2007

Se produit lorsque le panneau SIP est activé ou désactivé.

Espace de noms :  Microsoft.WindowsCE.Forms
Assembly :  Microsoft.WindowsCE.Forms (dans Microsoft.WindowsCE.Forms.dll)

Syntaxe

'Déclaration
Public Event EnabledChanged As EventHandler
'Utilisation
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);
}
JScript ne prend pas en charge les événements.

Notes

L'événement EnabledChanged se produit toutes les fois où le panneau SIP est activé ou désactivé, par l'utilisateur ou par programme. Lorsque cet événement se produit, vous pouvez déterminer si le panneau SIP est activé ou désactivé et repositionner ou redimensionner les contrôles en conséquence.

Vous pouvez déclencher cet événement en modifiant la propriété Enabled.

Exemples

L'exemple suivant utilise l'événement EnabledChanged pour réduire la hauteur d'un contrôle onglet lorsque le panneau SIP est activé. Il rétablit le contrôle onglet à sa hauteur d'origine lorsque le panneau SIP est désactivé. Cet exemple fait partie d'un exemple plus complet fourni pour le composant InputPanel.

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

Autorisations

Plateformes

Windows CE, Windows Mobile pour Pocket PC

Le .NET Framework et le .NET Compact Framework ne prennent pas en charge toutes les versions de chaque plateforme. Pour obtenir la liste des versions prises en charge, consultez Configuration requise du .NET Framework.

Informations de version

.NET Compact Framework

Pris en charge dans : 3.5, 2.0, 1.0

Voir aussi

Référence

InputPanel, classe

Membres InputPanel

Microsoft.WindowsCE.Forms, espace de noms

Enabled