Font in Ribbon Bar

2 posts, 1 answers
  1. Ching-Yen
    Ching-Yen avatar
    65 posts
    Member since:
    Nov 2007

    Posted 28 Mar 2008 Link to this post


    I am trying to show the font list in the combo box in the ribbon bar. Is that any possible to show the "sample" text in the combo box itself? So the user can preview the font before they selecting it.

    Please advice.
  2. Answer
    Martin Vasilev
    Martin Vasilev avatar
    1061 posts

    Posted 28 Mar 2008 Link to this post

    Hello Ching-Yen,

    Thank you for your question.

    You could set the different font for every single item in RadComboBox. Please refer to the code below:

    private void FillFontNameInCombo(RadComboBoxElement comboElement)  
        foreach (FontFamily font in FontFamily.Families)  
            RadComboBoxItem item = new RadComboBoxItem(font.Name);  
            item.MaxSize = new Size(0, 20);  
            if (font.IsStyleAvailable(FontStyle.Regular))  
                item.Font = new Font(font.Name, item.Font.Size);  

    I hope this was helpful. Do not hesitate to contact me again if you need further assistance.

    Sincerely yours,
    Martin Vasilev
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top