Create a Drop-down menu that is consistent with the SharePoint 2010 style

Source: Internet
Author: User

In the author company, SharePoint has been used on a large scale. More recently, in the IT-hosted SharePoint 2010 system, the top of the page was unified with an additional area, with two additional drop-down menus placed in the upper-right corner.

These two Drop-down menus provide users with some quick links, including access to it's support Web site, viewing information about the current Web site, and applying for a new SharePoint site from the system.

As you can see from the screenshot above, these two custom Drop-down menus use the built-in styles of SharePoint, and their styles are consistent with the Web operations on SharePoint 2010 pages and the Welcome menu. What if we were to create a drop-down menu that is consistent with the SharePoint 2010 style in our application?

To create a Drop-down menu that uses the SharePoint built-in style, you can create a custom class and let it inherit from the Microsoft.SharePoint.WebControls.ToolBarMenuButton class. By invoking the various properties and methods provided by the parent class, our custom class can add custom menu items to the menu.

In the code shown below, the basic style of the menu is initialized from line 18th to 28th. Basically, we'll reuse the CSS class and pictures that are built into SharePoint 2010. Line 19th displays the menu in large icon mode by specifying True for the Menutemplatecontrol.largeiconmode property.

Line 31st Specifies the text content displayed by the Drop-down menu through the Menucontrol.text property.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.