1.首先引入命名空间:
using FreeTextBoxControls;
2.插入中文字体相关代码:
Toolbar toolbar1 = MyContent.Toolbars[0];//此处的0表示第一个toolbar。
FontFacesMenu fontmenu =(FontFacesMenu) toolbar1.Items[1];//freetextbox中加载字体的类为FontFacesMenu ,这是FontFacesMenu 在toolar中的索引。
fontmenu.Items.Add(new ToolbarListItem("宋体", "宋体"));
fontmenu.Items.Add(new ToolbarListItem("黑体", "黑体"));
3相关前台代码:
<FTB:FreeTextBox ID="MyContent" Width="560" runat="server" Language="zh-CN" Height="200px" ToolbarStyleConfiguration="NotSet"
ButtonDownImage="True" ToolbarLayout="ParagraphMenu,FontFacesMenu,FontSizesMenu,FontForeColorsMenu,Bold,Italic,Underline,Strikethrough;JustifyLeft,JustifyRight,JustifyCenter,JustifyFull,BulletedList|Superscript,Subscript,RemoveFormat,NumberedList,Indent,Outdent;CreateLink,Unlink,InsertImage,InsertRule;Cut,Copy,Paste;Undo,Redo,InsertImageFromGallery"
ImageGalleryUrl="ftb.imagegallery.aspx?rif={0}&cif={0}" ButtonSet="Office2003" BreakMode="LineBreak">
</FTB:FreeTextBox>