Condividi tramite


Proprietà InputPanel.VisibleDesktop

Aggiornamento: novembre 2007

Ottiene un oggetto Rectangle che rappresenta l'area che non è nascosta dal SIP.

Spazio dei nomi:  Microsoft.WindowsCE.Forms
Assembly:  Microsoft.WindowsCE.Forms (in Microsoft.WindowsCE.Forms.dll)

Sintassi

'Dichiarazione
Public ReadOnly Property VisibleDesktop As Rectangle
'Utilizzo
Dim instance As InputPanel
Dim value As Rectangle

value = instance.VisibleDesktop
public Rectangle VisibleDesktop { get; }
public:
property Rectangle VisibleDesktop {
    Rectangle get ();
}
public function get VisibleDesktop () : Rectangle

Valore proprietà

Tipo: System.Drawing.Rectangle

Oggetto che rappresenta l'area che non è occupata dal SIP.

Note

La proprietà VisibleDesktop fornisce un oggetto Rectangle con le dimensioni dell'area del form non occupata dal SIP. Quando il SIP è attivato, è possibile riposizionare o ridimensionare i controlli in modo che rientrino in tale area. Se si sviluppano applicazioni per un dispositivo Windows Embedded CE diverso da un Pocket PC, la proprietà VisibleDesktop restituisce il rettangolo più grande dell'area del form non occupato dal SIP. Se il SIP non è contenuto nel form, la proprietà VisibleDesktop restituisce le dimensioni dell'area client del form.

Esempi

Nell'esempio riportato di seguito viene utilizzato l'evento EnabledChanged per ridurre l'altezza di un controllo Struttura a schede all'attivazione del SIP. L'altezza originale del controllo Struttura a schede viene ripristinata alla disattivazione del SIP. Nell'esempio viene esaminata la proprietà VisibleDesktop quando il SIP viene attivato e disattivato affinché sia possibile regolare l'altezza del controllo Struttura a schede in base al SIP. Questo esempio fa parte di un esempio più completo fornito per il componente 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);
}

Autorizzazioni

Piattaforme

Windows CE, Windows Mobile per Pocket PC

.NET Framework e .NET Compact Framework non supportano tutte le versioni di ciascuna piattaforma. Per un elenco delle versioni supportate, vedere Requisiti di sistema di .NET Framework.

Informazioni sulla versione

.NET Compact Framework

Supportato in: 3.5, 2.0, 1.0

Vedere anche

Riferimenti

InputPanel Classe

Membri InputPanel

Spazio dei nomi Microsoft.WindowsCE.Forms