Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

mpc Behavior

This topic documents a feature of Binary Behaviors, which are obsolete as of Internet Explorer 10.

Adds a multipage control to the document.

Syntax

XML <Prefix: PredefinedTag ID=sID STYLE="behavior:url('mpc.htc')" />
HTML <ELEMENT STYLE="behavior:url('mpc.htc')" ID=sID>
Scripting object .style.behavior = "url('mpc.htc')"
object .addBehavior ("mpc.htc")

Possible Values

Prefix Prefix that associates the PredefinedTag with an XML namespace. This prefix is set using the XMLNS attribute of the HTML tag.
PredefinedTag One of the following predefined tags:
containerDefines a container element for the mpc behavior.
pageDefines a page element for the mpc behavior. The contents of each page element provide the basis for each paged tab that is rendered by the behavior.
sID String that specifies a unique identifier for the object.

Members Table

The following table lists the members exposed by the mpc object.

Attributes/Properties
Attribute Property Description
background-color backgroundColor

Sets or retrieves the container background color of the mpc behavior.

color color

Sets or retrieves the container text color of the mpc behavior.

height height

Sets or retrieves the container height of the mpc behavior.

SELECTEDINDEX selectedIndex

Sets or retrieves the selected tab of the mpc behavior.

TABTEXT tabText

Sets or retrieves the text displayed in the multipage tab of the mpc behavior.

TABTITLE tabTitle

Sets or retrieves the text displayed as a ToolTip in the multipage tab of the mpc behavior.

td--tab-orientation tdTabOrientation

Sets or retrieves the location of the tabs within the container of the mpc behavior.

width width

Sets or retrieves the container width of the mpc behavior.

Events
Event Property Description
onchange

Fires when a tab is selected for the mpc behavior.

onfocus

Fires when a tab is selected for the mpc behavior.

Remarks

The behavior-defined members listed in the preceding table are not accessible through script until the window. onload event fires. Waiting for this event to fire ensures that the page is completely loaded, that all behaviors have been applied to corresponding elements on the page, and, consequently, that all the behavior's properties, methods, and events are available for scripting. Attempting to use any of the behavior-defined members will result in a scripting error indicating that the object does not support that particular member.

The mpc behavior is used to add both the multipage container and the individual page tabs. The type of control that results from applying the behavior is determined by the user-defined tag name that uses the behavior, as shown in the sample code below.

The mpc.htc file can be downloaded from the mpc  sample page.

Example

This sample demonstrates the implementation of the mpc behavior to add a multipage control to a Web page.


<HTML XMLNS:MPC>
<HEAD>
<STYLE>
@media all{
   MPC\:CONTAINER {behavior:url(mpc.htc);}
   MPC\:PAGE {behavior:url(mpc.htc);}
}
</STYLE>
</HEAD>
<BODY onload="oMPC.style.visibility='visible'">
<MPC:CONTAINER ID="oMPC" STYLE="width:400; height:250;">
   <MPC:PAGE
      TABTITLE="This is a title, also"
      TABTEXT="Some Text">'
         This is some sample text...
   </MPC:PAGE>
   <MPC:PAGE
      TABTITLE="Title"
      TABTEXT="Image">
         <IMG SRC="flag.gif"
         WIDTH="171"
         HEIGHT="80">
   </MPC:PAGE>
</MPC:CONTAINER>
</BODY>
</HTML>

Code example: http://samples.msdn.microsoft.com/workshop/samples/author/behaviors/library/mpc/mpc.htm

See Also

Community Additions

Show:
© 2015 Microsoft