使控制項在運行時不可見

來源:互聯網
上載者:User

使控制項在運行時不可見
http://msdn.microsoft.com/library/chs/default.asp?url=/library/chs/vbcon/html/vbtskmakingyourcontrolinvisibleatruntime.asp

有時可能需要建立在運行時不可見的使用者控制項。例如,除在鬧鈴響時外,用作鬧鐘的控制項可以不可見。通過設定 Visible 屬性很容易做到這一點。如果 Visible 屬性為 true,則控制項將正常顯示。如果為 false,則控制項將隱藏。儘管在不可見狀態下控制項中的代碼仍可運行,但您無法通過使用者介面與控制項互動。如果想建立仍可響應使用者輸入(例如按一下滑鼠)的不可見控制項,則應建立透明控制項。有關更多資訊,請參見使控制項擁有透明背景。

使控制項在運行時不可見

將 Visible 屬性設定為 false。
' Visual Basic
' To set the Visible property from within your object's own code.
Me.Visible = False
' To set the Visible property from another object.
myControl1.Visible = False

// C#
// To set the Visible property from within your objects own code.
this.Visible = false;
// To set the Visible property from another object.
myControl1.Visible = false;
 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.