Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Quick way to grab System Fonts?

Status
Not open for further replies.

mcox05

Programmer
Apr 25, 2006
25
US
Just hoping the is a quick way to obtain a collection of system fonts so that I don't have to manually type them all in.

Any ideas?
 
InstalledFontCollection

Google system fonts c#

Example:

Code:
using System;
using System.Drawing;
using System.Drawing.Text;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;

namespace fonts
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            InstalledFontCollection fonts = new InstalledFontCollection();
            foreach (FontFamily family in fonts.Families)
            {
                comboBox1.Items.Add(family.Name);
            }
        }
    }
}

[sub]____________ signature below ______________
You may get help by means of code here. Just recall what happens to a rat when he eats the cheese off a rat trap while you're Ctrl+C/Ctrl+V'ing that code as your own[/sub]
 
I wouldn't go that far but thank you :)

[sub]____________ signature below ______________
You may get help by means of code here. Just recall what happens to a rat when he eats the cheese off a rat trap while you're Ctrl+C/Ctrl+V'ing that code as your own[/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top