共用方式為


InputPanel.VisibleDesktop 屬性

取得 Rectangle 物件,這個物件表示螢幕輸入面板 (SIP) 未遮蔽的區域。

命名空間:  Microsoft.WindowsCE.Forms
組件:  Microsoft.WindowsCE.Forms (在 Microsoft.WindowsCE.Forms.dll 中)

語法

'宣告
Public ReadOnly Property VisibleDesktop As Rectangle
'用途
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

屬性值

型別:System.Drawing.Rectangle

表示螢幕輸入面板 (SIP) 未佔用區域的物件。

備註

VisibleDesktop 屬性可提供 Rectangle,其中包含 SIP 未佔用的表單區域大小。啟用 SIP 時,可以重新調整要顯示於這個區域中的控制項之位置或大小。如果您是針對 Pocket PC 以外的 Windows Embedded CE 架構裝置來進行開發,則 VisibleDesktop 屬性會傳回 SIP 未佔用的最大矩形表單區域。如果 SIP 在表單的外面,則 VisibleDesktop 會傳回表單的工作區大小。

範例

下列範例會在 SIP 為啟用時使用 EnabledChanged 事件,以降低索引標籤控制項的高度。停用 SIP 時,它會將索引標籤控制項恢復為原始的高度。範例中會在啟用及停用 SIP 時檢查 VisibleDesktop 屬性,以便調整索引標籤控制項的高度來容納 SIP。這個範例是 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);
}

使用權限

平台

Windows CE, Windows Mobile for Pocket PC

.NET Framework 和 .NET Compact Framework 並不支援各種平台的所有版本。如需支援平台版本的相關資訊,請參閱 .NET Framework 系統需求

版本資訊

.NET Compact Framework

支援版本:3.5、2.0、1.0

請參閱

參考

InputPanel 類別

InputPanel 成員

Microsoft.WindowsCE.Forms 命名空間