// Sets an Attribute to the specific attribute.
BrowsableAttribute myAttribute = BrowsableAttribute.Yes;
if (attributes.Contains(myAttribute))
textBox1.Text = "button1 has a browsable attribute.";
else
textBox1.Text = "button1 does not have a browsable attribute.";
// Gets the designer attribute from the collection.
DesignerAttribute myDesigner;
myDesigner = (DesignerAttribute)attributes[typeof(DesignerAttribute)];
// Prints the value of the attribute in a text box.
textBox1.Text = myDesigner.DesignerTypeName;