共用方式為


Properties Window Overview

Applies to: yesVisual Studio noVisual Studio for Mac

Note

This article applies to Visual Studio 2017. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here

The Properties window is used to display properties for objects selected in the two main types of windows available in the Visual Studio integrated development environment (IDE). These two types of windows are:

  • Tool windows such as Solution Explorer, Class View, and Object browser

  • Document windows containing such editors and designers as the forms designer, XML editor, and HTML editor

Using the Properties Window

The Properties window displays the properties of single or multiple selected items. If multiple items are selected, the intersection of all properties for all selected objects is displayed.

Events related to a selected object within a form design window or HTML editor using COM+ metadata are displayed in the Properties window. For example, you can select a button and display its associated events, such as an OnClick event, which can be linked to that button.

Events displayed in the Properties window are primarily used with objects that are bound to code. If you are editing a file format that does not have anything to do with code, you are not going to have any events. Events are only displayed in the Properties window when there is a binding between running code and certain events associated with specific objects. An example of this would be code behind a selected object that executes when that object is activated.

The following table lists the primary interfaces used by the Properties window.

Interface Name Description
ICategorizeProperties Provides a list of categories to the Properties window and maps each property to a category.
IDispatch Interface Exposes an object's methods and properties to programming tools and other applications that support automation.
IProvidePropertyBuilder Provides ellipsis (...) buttons called builders that open modal dialog windows implemented by the object itself. Used when a value is not easily typed by the user in a text field. For example, it might be used to open a color picker that determines the RGB value for you.
ISelectionContainer Provides access to objects used to update information displayed in the Properties window. ISelectionContainer is implemented by VSPackages for each window that contains selectable objects with related properties to be displayed.
ITypeInfo Provides information about the type of an object such as methods of an interface and fields of a structure.
IVsMonitorSelection Enables VSPackages to receive notification of selection events and to retrieve information about the current project hierarchy, item, element value, and command UI context.
IVsMultiItemSelect Provides the environment with access to multiple selections.
IVsPerPropertyBrowsing Used to provide localized names on some properties displayed in the Properties window.
IVsSelectionEvents Notifies registered VSPackages of changes to the current selection, element value, or command UI context.
IVsTrackSelectionEx Notifies the environment of a change in the current selection and provides access to hierarchy and item information relating to the new selection.

For further information on IDispatch, see the MSDN library.

See also