Share via


createDropDownListAt Method

Creates a ToolbarDropDownList on the Toolbar at the specified index.

Syntax

ToolbarDropDownList = TOOLBAR.createDropDownListAt(iIndex)

Parameters

iIndex Required. Integer that specifies which index position on the Toolbar to create the ToolbarDropDownList element.

Return Value

The ToolbarDropDownList that is created by the method.

Example

The following example shows how to use the createDropDownListAt method to add a ToolbarDropDownList object to a Toolbar.


<HTML xmlns:mytb>
<?import namespace="mytb" implementation="toolbar.htc">
<HEAD>
<LINK REL="stylesheet" HREF="/workshop/samples/samples.css" TYPE="text/css">
<TITLE>createCheckGroupAt Method</TITLE>
<SCRIPT LANGUAGE="JScript">
function addDropDownList(index)
{
    // Create the checkButtonGroup
    var oDropDown = oToolBar.createDropDownListAt(index);
    var aOptions = oDropDown.getOptions();  
    var oOption = document.createElement("OPTION");
    aOptions.add(oOption);
    oOption.innerText = "One";
    oOption.Value = "1";
    oOption = document.createElement("OPTION");
    aOptions.add(oOption);
    oOption.innerText = "Two";
    oOption.Value = "2";
}
</SCRIPT>
</HEAD>
<BODY>

<!-- Form controls -->
Index: <INPUT type="text" size="3" id="oIndex" value="0" ></INPUT>

<!-- Press this to add a drop-down-list. -->
<BUTTON onclick="addDropDownList(oIndex.value)">
Add</BUTTON>

<!-- Here is the toolbar -->
<mytb:toolbar id="oToolBar">
<mytb:toolbarbutton imageUrl="/workshop/graphics/tool-mail.gif" />
<mytb:toolbarseparator />
<mytb:toolbarbutton imageUrl="/workshop/graphics/tool-reply.gif" Text="Reply" title="Reply" />
<mytb:toolbarbutton imageUrl="/workshop/graphics/tool-reply_all.gif" Text="Reply All" 
title="Reply to All" DefaultStyle="font-weight:bold" HoverStyle="color:blue" 
SelectedStyle="color:red" />
<mytb:toolbarbutton imageUrl="/workshop/graphics/tool-forward.gif" Text="Forward" 
title="Forward" DefaultStyle="font-style:italic" />
<mytb:toolbarseparator />
<mytb:toolbarcheckbutton selected="true" imageurl="/workshop/graphics/tool-calendar.gif" 
text="Meetings" title="Turn on meeting reminders" />
</mytb:toolbar>

</BODY>
</HTML>       

Code example: https://samples.msdn.microsoft.com/workshop/samples/webcontrols/toolbar/createDropDownListAt.htm

Applies To

TOOLBAR

See Also

Internet Explorer WebControls, About the Toolbar WebControl