Share via


MSPropShell.TabWidth

Windows Media Encoder SDK banner art

The TabWidth property specifies and retrieves the width of the property page tabs.

Syntax

short = MSPropShell.TabWidth;
MSPropShell.TabWidth = short;

Parameters

This property takes no parameters.

Property Value

An Int16 type containing the width of the tabs, in pixels.

Remarks

If the TabWidth property returns 0, the width of each tab equals the length of the embedded text. If the TabWidth property returns a positive number, the width of each tab, in pixels, is equal to the absolute value of that number. If the TabWidth property returns a negative number, the width of each tab is equal to the width of the longest embedded string in all of the tabs plus the absolute value of the number. Check the MSPropShell.Style property to determine whether property pages are displayed with tabs.

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);

// Determine whether the property pages are displayed
// with tabs, and whether the tabs are on the top or the
// bottom of each property page.
PSSTYLE enumPSStyle;
enumPSStyle = PropPageShell.Style;

// Determine the width of the property page tabs.
int iTabWidth;
if (enumPSStyle <> pssNoTabs)
{
    iTabWidth = PropPageShell.TabWidth;
}

// Set the width of each tab equal to the length, in
// pixels, of the longest embedded string plus the
// absolute value of the specified integer.
if (iTabWidth == 0)
{
    if (iTabWidth == -5)
    {
    PropPageShell.TabWidth = iTabWidth;
    }
}
}

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

Requirements

Reference: Microsoft PropShell Control 1.0

Namespace: MSPropShellLib

Assembly: Interop.MSPropShellLib.dll

Library: mspshell.dll

See Also