This is a migrated thread and some comments may be shown as answers.

Font in Ribbon Bar

1 Answer 53 Views
RibbonBar
This is a migrated thread and some comments may be shown as answers.
Ching-Yen
Top achievements
Rank 1
Ching-Yen asked on 28 Mar 2008, 04:14 PM
Hi,

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.

1 Answer, 1 is accepted

Sort by
0
Accepted
Martin Vasilev
Telerik team
answered on 28 Mar 2008, 06:01 PM
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);  
        }  
 
        comboElement.Items.Add(item);  
    }  

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
Tags
RibbonBar
Asked by
Ching-Yen
Top achievements
Rank 1
Answers by
Martin Vasilev
Telerik team
Share this question
or