ControlCollection.Remove メソッド
アセンブリ: System.Web (system.web.dll 内)



Remove メソッドを使用して、myButton サーバー コントロールから子コントロールを削除するコード例を次に示します。このコードは、まず Contains メソッドを使用して ControlCollection オブジェクトに myChildControl が含まれているかどうかを確認し、含まれていればそれを削除します。
' Use the Contains method to check whether ' a child control exists, and if it does, ' use the Remove method to delete it. If myButton.Controls.Contains(myChildControl) myButton.Controls.Remove(myChildControl) msgRemove.Text = "You removed myLiteralControl." Else msgRemove.Text="The control to remove does not exist." End If

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


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

- ControlCollection.Remove メソッドのページへのリンク