-> First of all start visual studio 2008, 2010, 2012 etc.
-> Click on windows form application
-> Name the new form load installed fonts (or whatever you want).
-> Add 1 listBox and 1 Button from Toolbox.
or
-> Design your form as bellow.
-> Add a reference to the System.Drawing.Text namespace as highlight bellow:
The InstalledFontCollection class defines a class that represents the fonts installed on the system.
-> Run Your Program.
-> Click on windows form application
-> Name the new form load installed fonts (or whatever you want).
-> Add 1 listBox and 1 Button from Toolbox.
or
-> Design your form as bellow.
-> Add a reference to the System.Drawing.Text namespace as highlight bellow:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Drawing.Text;
-> Now double click the export to excel 2007 button and write the following code
Code
for Load listBox Button
|
InstalledFontCollection fonts = new InstalledFontCollection();
try
{
foreach (FontFamily
fontnames in fonts.Families)
{
listBox1.Items.Add(fontnames.Name);
}
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
|
-> Run Your Program.
0 comments:
Post a Comment