Control.Hide メソッド
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)


コントロールを非表示にすることは、Visible プロパティを false に設定することと同じです。Hide メソッドが呼び出された後、Visible プロパティは Show メソッドが呼び出されるまで、false の値を返します。

ボタンがクリックされたときに Ctrl キーが押されている場合、そのボタンを非表示にするコード例を次に示します。この例では、button1 という Button が Form 上に存在している必要があります。
Private Sub button1_Click(sender As Object, _ e As EventArgs) Handles button1.Click ' If the CTRL key is pressed when the ' control is clicked, hide the control. If Control.ModifierKeys = Keys.Control Then CType(sender, Control).Hide() End If End Sub
private void button1_Click(object sender, System.EventArgs e) { /* If the CTRL key is pressed when the * control is clicked, hide the control. */ if(Control.ModifierKeys == Keys.Control) { ((Control)sender).Hide(); } }

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からControl.Hide メソッドを検索する場合は、下記のリンクをクリックしてください。

- Control.Hide メソッドのページへのリンク