This topic has not yet been rated - Rate this topic

Actions Pane Subpane Control Sample

Download sample

Note Required applications

The features in this topic are available only if you have the required applications installed.

For more information, see Features Available by Product Combination.

  • One of these development environments:

    VSTO 2005

    -or-

    Visual Studio Team System

  • Microsoft Office 2003

This sample demonstrates custom user controls on an actions pane, and includes a collapsible container control (the subpane control) that helps you organize controls on an actions pane. The sample also shows how to respond to events generated from controls hosted on a subpane control.

There is one project in this sample solution: a Microsoft Office Word 2003 application project that contains the sample control.

Security noteSecurity Note

This sample code is provided to illustrate a concept and should not be used in applications or Web sites, as it may not illustrate the safest coding practices. Microsoft assumes no liability for incidental or consequential damages should the sample code be used for purposes other than as intended.

For information about installing the sample project on your computer, see How to: Download Sample Files in Help Topics.

To run this sample

  • Press F5.

Demonstrates

The subpane control is a collapsible container that can host other controls such as list boxes and text boxes. You add a user control to your project and then drag and drop one or more subpane controls onto the user control design surface. You can use multiple subpane controls as necessary and populate them with the controls required by the project. You then write code to associate the subpane controls with the document’s actions pane, and then program against the controls on any of the subpanes.

The control has the following properties, methods, and events:

Properties:

  • Text. The text that appears in the title bar of a given sub-pane.

  • HighlightColor. The color of the title bar when it has been selected by the user.

  • GradientBeginColor. The color beginning on the left side of the title bar.

  • GradientEndColor. The color ending on the right side of the title bar.

  • IsExpanded. Indicates whether the subpane is expanded; that is, showing its list of items.

  • IsAnimated. Indicates whether the subpane rolls up or rolls down when it is expanded or collapsed.

Methods:

  • Expand. Expands the control. This method does nothing if the control is already expanded.

  • Collapse. Collapses the control. This method does nothing if the control is already collapsed.

Events:

  • BeforeExpanding. An event that is executed before the control is expanded.

  • BeforeCollapsing. An event that is executed before the control collapses.

  • AfterExpand. An event that is executed after the control is expanded.

  • AfterCollapse. An event that is executed after the control collapses.

See Also

Did you find this helpful?
(1500 characters remaining)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.