DesignerActionList.AutoShow Property

 

Gets or sets a value indicating whether the smart tag panel should automatically be displayed when it is created.

Namespace:   System.ComponentModel.Design
Assembly:  System.Design (in System.Design.dll)

public virtual bool AutoShow { get; set; }

Property Value

Type: System.Boolean

true if the panel should be shown when the owning component is created; otherwise, false. The default is false.

If the property value is set to true, the component with which this DesignerActionList is associated will automatically expand and display the smart tag panel when the component is created.

You can opt out of this behavior by setting the DesignerOptions.ObjectBoundSmartTagAutoShow property to false.

The following code example demonstrates how to create a collection of DesignerActionItem objects.

For a complete explanation of this code example, see How to: Attach Smart Tags to a Windows Forms Component.

public override DesignerActionItemCollection GetSortedActionItems()
{
    DesignerActionItemCollection items = new DesignerActionItemCollection();

    //Define static section header entries.
    items.Add(new DesignerActionHeaderItem("Appearance"));
    items.Add(new DesignerActionHeaderItem("Information"));

    //Boolean property for locking color selections.
    items.Add(new DesignerActionPropertyItem("LockColors",
                     "Lock Colors", "Appearance",
                     "Locks the color properties."));
    if (!LockColors)
    {
        items.Add(new DesignerActionPropertyItem("BackColor",
                         "Back Color", "Appearance",
                         "Selects the background color."));
        items.Add(new DesignerActionPropertyItem("ForeColor",
                         "Fore Color", "Appearance",
                         "Selects the foreground color."));

        //This next method item is also added to the context menu 
        // (as a designer verb).
        items.Add(new DesignerActionMethodItem(this,
                         "InvertColors", "Invert Colors",
                         "Appearance",
                         "Inverts the fore and background colors.",
                          true));
    }
    items.Add(new DesignerActionPropertyItem("Text",
                     "Text String", "Appearance",
                     "Sets the display text."));

    //Create entries for static Information section.
    StringBuilder location = new StringBuilder("Location: ");
    location.Append(colLabel.Location);
    StringBuilder size = new StringBuilder("Size: ");
    size.Append(colLabel.Size);
    items.Add(new DesignerActionTextItem(location.ToString(),
                     "Information"));
    items.Add(new DesignerActionTextItem(size.ToString(),
                     "Information"));

    return items;
}

.NET Framework
Available since 2.0
Return to top
Show: