我有freetextbox3.3.1,但是没有源文件,貌似现在网上没有源文件我想在字体列表里添加系统支持的字体,不会啊,求高手帮助!!!如果有源码的话就更好了,我的vs2008,.net3.5,求大虾帮助
QQ:260741104
谢谢了啊

解决方案 »

  1.   


    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>
      

  2.   


    你找到它的源文件工程 
    找到这个文件“FreeTextBox.cs”,修改下面这一段,然后编译成dll,然后再引用。 
    我是这样做的。 
    ////////////////////////////////////////////// 
    public   string[]   FontFacesMenuList   { 
    get   {   
    object   savedState   =   this.ViewState[ "FontFacesMenuList "]; 
    return   (savedState   ==   null)   ? 
    new   string[]   { "Arial ", "Courier   New ", "Garamond ", "Georgia ", "Tahoma ", "Times   New   Roman ", "Verdana ", "宋体 ", "黑体 ", "隶书 ", "楷体_GB2312 ", "幼圆 ", "仿宋_GB2312 ", "方正姚体 ", "方正舒体 "}   : 
    (string[])   savedState; 

    set   { 
    ViewState[ "FontFacesMenuList "]   =   value; 

    }以下是在freetextbox中一些控制外观的方法,你可以自己修改一下 
    //增加字体 
    public   string[]   FontFacesMenuList   { 
    get   {   
    object   savedState   =   this.ViewState[ "FontFacesMenuList "]; 
    return   (savedState   ==   null)   ? 
    new   string[]   { "Arial ", "Courier   New ", "Garamond ", "Georgia ", "Tahoma ", "Times   New   Roman ", "Verdana "}   : 
    (string[])   savedState; 

    set   { 
    ViewState[ "FontFacesMenuList "]   =   value; 

    } //增加字体大小 
    public   string[]   FontSizesMenuList   { 
    get   { 
    object   savedState   =   this.ViewState[ "FontSizesMenuList "]; 
    return   (savedState   ==   null)   ? 
    new   string[]   { "1 ", "2 ", "3 ", "4 ", "5 ", "6 "}   : 
    (string[])   savedState; 

    set   { 
    ViewState[ "FontSizesMenuList "]   =   value; 

    } //增加字体颜色 
    public   Color[]   FontForeColorsMenuList   { 
    get   {   
    object   savedState   =   this.ViewState[ "FontForeColorsMenuList "]; 
    return   (savedState   ==   null)   ? 
    new   Color[]   {Color.Black,   Color.Gray,   Color.DarkGray,   Color.LightGray,   Color.White,   Color.Aquamarine,   Color.Blue,   Color.Navy,   Color.Purple,   Color.DeepPink,   Color.Violet,   Color.Pink,   Color.DarkGreen,   Color.Green,   Color.YellowGreen,   Color.Yellow,   Color.Orange,   Color.Red,   Color.Brown,   Color.BurlyWood,   Color.Beige}   : 
    (Color[])   savedState; 

    set   { 
    ViewState[ "FontForeColorsMenuList "]   =   value; 

    } //增加字体颜色名称 public   string[]   FontForeColorsMenuNames   { 
    get   { 
    object   savedState   =   this.ViewState[ "FontForeColorsMenuNames "]; 
    return   (savedState   ==   null)   ? 
    new   string[]   { "Black ",   "Gray ",   "DarkGray ",   "LightGray ",   "White ",   "Aquamarine ",   "Blue ",   "Navy ",   "Purple ",   "DeepPink ",   "Violet ",   "Pink ",   "DarkGreen ",   "Green ",   "YellowGreen ",   "Yellow ",   "Orange ",   "Red ",   "Brown ",   "BurlyWood ",   "Beige "}   : 
    (string[])   savedState; 

    set   { 
    ViewState[ "FontForeColorsMenuNames "]   =   value; 

    } //增加背景颜色 
    public   Color[]   FontBackColorsMenuList   { 
    get   { 
    object   savedState   =   this.ViewState[ "FontBackColorsMenuList "]; 
    return   (savedState   ==   null)   ? 
    new   Color[]   {Color.Black,   Color.Gray,   Color.DarkGray,   Color.LightGray,   Color.White,   Color.Aquamarine,   Color.Blue,   Color.Navy,   Color.Purple,   Color.DeepPink,   Color.Violet,   Color.Pink,   Color.DarkGreen,   Color.Green,   Color.YellowGreen,   Color.Yellow,   Color.Orange,   Color.Red,   Color.Brown,   Color.BurlyWood,   Color.Beige}   : 
    (Color[])   savedState; 

    set   { 
    ViewState[ "FontBackColorsMenuList "]   =   value; 

    } //增加背景颜色名称 public   string[]   FontBackColorsMenuNames   { 
    get   { 
    object   savedState   =   this.ViewState[ "FontBackColorsMenuNames "]; 
    return   (savedState   ==   null)   ? 
    new   string[]   { "Black ",   "Gray ",   "DarkGray ",   "LightGray ",   "White ",   "Aquamarine ",   "Blue ",   "Navy ",   "Purple ",   "DeepPink ",   "Violet ",   "Pink ",   "DarkGreen ",   "Green ",   "YellowGreen ",   "Yellow ",   "Orange ",   "Red ",   "Brown ",   "BurlyWood ",   "Beige "}   : 
    (string[])   savedState; 

    set   { 
    ViewState[ "FontBackColorsMenuNames "]   =   value; 

    }
      

  3.   

    感谢这位大侠,第一个方法我用过了,但是捏,我的项目报错了,他说
    FontFacesMenu fontmenu =(FontFacesMenu) toolbar1.Items[1];
    这句话有错误,类型不能强制转换为FontFacesMenu,表示很郁闷,网上人都是真么写的,到我这里就不能转换,至于第二个方法,我是真的找不到源码,下载了n个版本,都没有,大虾有么?????