This menu is inspired by the menus found in various Microsoft releases. It's not an exact duplication, but serves as a good demonstration how backgrounds and dividers can be customized with graphics. It also shows the <b>ShadowEnabled</b> feature which is veiwed in IE 5 and greater running on Windows.
<p>
It uses the <b>WebMenu.BackgroundImage</b> property to create a tiling background which displays the dark and light colors of the menu. In order to make the background image visible, the <b>WebMenu.BackgroundColor</b> needs to be set to an empty string.
<p>
Each Item contains a 16px <b>IconImage</b>, either a graphic or a blank (transparent) gif. The blank gif is necessary to force all of the <b>Item.Captions</b> to line up. Although not demonstrated in this sample, it is also possible to set the <b>SelectedIconImage</b> property so that the icon will change appearance when the mouse is positioned over an Item.
<p>
To create the dividers, the <b>DividerImage</b>, <b>DividerColor</b> and <b>DividerImageAlignment</b> properties were used. The <b>DividerImage</b> is a short graphic, aligned to the left, which constitutes the dark and light transition between the dark colored icon space and the light colored padding area before the Caption begins. The <b>DividerColor</b> is set to the same color as the icon space, which appears through the remainder of the menu's width. An optional approach would be to create a long 1px high image representing the entire divider and then setting the <b>DividerBackgroundImage</b> property. In that case, the <b>DividerBackgroundColor</b> must be set to an empty string.
<p>
This sample also demonstrates the use of the <b>WebMenu.OnShow</b> and <b>WebMenu.OnHide</b> events. Each is used to call a custom client-side function (SwapButton) which changes the images of the menu button associated with the menu that is displayed.
</td>
</tr>
<tr>
<td colspan=2>
<p><b>View the Code:</b></td>
</tr>
<tr>
<td width=10></td>
<td>
<p>
The code for this sample is available in the product installation directory:
<ul>
<li><b>netmenu.wms</b> - The WebMenu Studio project file.
<li><b>netmenu.wmt</b> - The Preview template used by the Studio's Live Preview window.
<li><b>default.htm (this file)</b> - Uses the WebMenu compiled output and discusses the sample.
<li><b>./includes/*</b> - The WebMenu output compiled from the studio application.
<li><b>./images/*</b> - The images used in this sample.