Click here to Skip to main content
15,886,199 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi dear

how i can show total fonts that is on my computer in a listbox or comboBox?
thanks
Posted

Here some links that explains how to do it in a detailed way.
Managed Font Combobox[^]
FontComboBox - a font listing combo box for .NET[^]
Additional link 1[^]
Additional link 2[^]
-or the shortest you can use this code;

C#
List<string> fonts = new List<string>();  
foreach (FontFamily font in System.Drawing.FontFamily.Families) 
{     
  fonts.Add(font.Name); 
}

and bind the combobox with the list.

Good luck
 
Share this answer
 
v5
Comments
Sander Rossel 19-Oct-11 16:32pm    
Tried to edit out the closing </string> tags. But failed miserably 3 times in a row... :-O
My 5 for the solution though!
Orcun Iyigun 19-Oct-11 16:52pm    
Thanks for the upvote :) well i see the "v5" here appreciate the hard work :)
Have a look at the solution provided here Binding Installed fonts in dropdownlist using LINQ[^] and here Bind fonts to a dropdownlist in C#[^]
 
Share this answer
 
v2
It might be helpful,
C#
cmbFonts.DataSource = System.Drawing.FontFamily.Families.Select(family => family.Name).ToList<string>();


:)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900