ComponentOne WebEditor for ASP.NET: WebEditor for ASP.NET Task-Based Help > Customizing the Font Drop-Down List

Customizing the Font Drop-Down List

By default, the Font drop-down list contains seven list items: Arial, Courier New MS, Garamond, Tahoma, Times New Roman, Verdana, and Wingdings. In this topic, you will learn how customize the Font drop-down list using code.

To customize the list, complete these steps:

1.   Import the following namespace into your project:

      Visual Basic

Imports C1.Web.Editor

      C#

using C1.Web.Editor;

2.   Clear the default list by adding the following code to the Page_Load event:

      Visual Basic

C1WebEditor1.FontList.Clear()

      C#

C1WebEditor1.FontList.Clear();

3.   Add the Times New Roman, Trebuchet MS, and Verdana fonts to the list by adding the following code to the Page_Load event:

      Visual Basic

C1WebEditor1.FontList.Add("Times", "Times New Roman")

C1WebEditor1.FontList.Add("Trebuchet", "Trebuchet MS")

C1WebEditor1.FontList.Add("Verdana", "Verdana")


      C#

C1WebEditor1.FontList.Add("Times", "Times New Roman");

C1WebEditor1.FontList.Add("Trebuchet", "Trebuchet MS");

C1WebEditor1.FontList.Add("Verdana", "Verdana");


4.   Build the project.

 This Topic Illustrates the Following:

Once you've built the project, click the Font drop-down arrow and observe that only three items – Times, Trebuchet, and Verdana –  appear on the list. The list will resemble the following:

 


Send comments about this topic to ComponentOne.
Copyright © 1987-2010 ComponentOne LLC. All rights reserved.
￿