Share via


MSPropShell.AutoRefresh

Windows Media Encoder SDK banner art

The AutoRefresh property specifies and retrieves a Boolean value indicating whether the property pages are automatically refreshed when either a new property page or a WMEncoder object is attached to them.

Syntax

bool = MSPropShell.AutoRefresh;
MSPropShell.AutoRefresh = bool;

Parameters

This property takes no parameters.

Property Value

A Boolean that indicates whether the property pages will be automatically refreshed.

Remarks

By default, this property returns true. You can attach WMEncoder objects to property pages by calling either the MSPropShell.Refresh method or by setting the AutoRefresh property to true and calling MSPropShell.AddObject. You can attach new property pages to existing property pages by calling either the Refresh method or by setting the AutoRefresh property to true and calling MSPropShell.AddPage.

To use the MSPropShell control, you must add the Microsoft PropShell Control 1.0 reference to the project, and add the MS PropShell Ctrl Class component to the Toolbox. For more information, see Programming in C#.

Example Code

using WMEncoderLib;
using MSPROPSHELLLib;

try
{
// Create a WMEncoder object.
WMEncoder Encoder;
Encoder = new WMEncoder();

// Create the Windows Media Encoder property pages.
WMEncSourcesPage PpgSources = new WMEncSourcesPage();
WMEncDisplayInfoPage PpgDesc = new WMEncDisplayInfoPage();
WMEncAttributesPage PpgAttr = new WMEncAttributesPage();
WMEncProfilePage PpgProfile = new WMEncProfilePage();
WMEncOutputPage PpgOutput = new WMEncOutputPage();

// Add Windows Media Encoder to the property page shell.
// You must add the encoder before adding the property pages.
PropPageShell.AddObject(Encoder);

// Add the property pages to the property page shell. To create an
// MSPropShell ActiveX control, on the Project menu, click Components,
// and then in the Components dialog box, select Microsoft PropShell
// Control 1.0. In the following example, the ActiveX control is
// named PropPageShell.
PropPageShell.AddPage(PpgSources);
PropPageShell.AddPage(PpgDesc);
PropPageShell.AddPage(PpgAttr);
PropPageShell.AddPage(PpgProfile);
PropPageShell.AddPage(PpgOutput);

// Reorder the pages. Call the RemoveAllPages method to remove all
// property pages from the MSPropShell control.
PropPageShell.RemoveAllPages();

// Set the AutoRefresh property to false so that the
// MSPropShell control is not refreshed when each new page is added.
PropPageShell.AutoRefresh = false;

// Add the property pages in the desired order.
PropPageShell.AddPage(PpgOutput);
PropPageShell.AddPage(PpgAttr);
PropPageShell.AddPage(PpgProfile);
PropPageShell.AddPage(PpgSources);
PropPageShell.AddPage(PpgDesc);

// Refresh the MSPropShell ActiveX control.
PropPageShell.Refresh();
}

catch (Exception e)
{
     // TODO: Handle exceptions.
}

Requirements

Reference: Microsoft PropShell Control 1.0

Namespace: MSPropShellLib

Assembly: Interop.MSPropShellLib.dll

Library: mspshell.dll

See Also