How do I prevent a control from appearing in the Toolbox?
At times you may create custom controls that you do not want to be added to the Visual Studio Toolbox. To do this, use the ToolboxItem attribute as follows:
In C#:
using System.ComponentModel; // Place at the top of the source code file
[ToolboxItem (false)]
public class CustomControl : Control
{
}
And In VB .NET:Imports System.ComponentModel ' Place at the top of the source code file
<ToolboxItem(False)>
Public Class CustomControl
Inherits Control
End Class
© (c) 2026 Oak Leaf Enterprises, Inc., 1996-2026 • Updated: 09/17/05
Comment or report problem with topic
