This documentation is archived and is not being maintained.

ToolboxBrowsableAttribute Constructor

Initializes a new instance of the ToolboxBrowsableAttribute class.

Namespace:  Microsoft.Windows.Design
Assembly:  Microsoft.Windows.Design.Interaction (in Microsoft.Windows.Design.Interaction.dll)

public ToolboxBrowsableAttribute(
	bool browsable


Type: System.Boolean
true to enable visibility for a control in a toolbox browser; otherwise, false.

The following code example shows how to use the ToolboxBrowsableAttribute to enable visibility for a custom control in a designer's toolbox browser.

// Container for any general design-time metadata to initialize.
// Designers look for a type in the design-time assembly that 
// implements IProvideAttributeTable. If found, designers instantiate 
// this class and access its AttributeTable property automatically.
internal class Metadata : IProvideAttributeTable
    // Accessed by the designer to register any design-time metadata.
    public AttributeTable AttributeTable
            AttributeTableBuilder builder = new AttributeTableBuilder();

                new ToolboxBrowsableAttribute(true));

            return builder.CreateTable();