FontFamily クラス
アセンブリ: System.Drawing (system.drawing.dll 内)
構文
Public NotInheritable Class FontFamily Inherits MarshalByRefObject Implements IDisposable
public sealed class FontFamily : MarshalByRefObject, IDisposable
public final class FontFamily extends MarshalByRefObject implements IDisposable
public final class FontFamily extends MarshalByRefObject implements IDisposable
FontFamily クラスの Families プロパティに含まれるすべてのフォント ファミリを次のコード例に示します。この例は、Windows フォームでの使用を意図してデザインされています。この例を実行するには、listBox1 という名前の ListBox をフォームに追加し、フォームのコンストラクタから PopulateListBoxWithFonts メソッドを呼び出します。
Private Sub PopulateListBoxWithFonts() listBox1.Width = 200 listBox1.Location = New Point(40, 120) Dim oneFontFamily As FontFamily For Each oneFontFamily In FontFamily.Families listBox1.Items.Add(oneFontFamily.Name) Next End Sub
private void PopulateListBoxWithFonts() { listBox1.Width = 200; listBox1.Location = new Point(40, 120); foreach ( FontFamily oneFontFamily in FontFamily.Families ) { listBox1.Items.Add(oneFontFamily.Name); } }
private: void PopulateListBoxWithFonts() { listBox1->Width = 200; listBox1->Location = Point(40,120); System::Collections::IEnumerator^ myEnum = FontFamily::Families->GetEnumerator(); while ( myEnum->MoveNext() ) { FontFamily^ oneFontFamily = safe_cast<FontFamily^>(myEnum->Current); listBox1->Items->Add( oneFontFamily->Name ); } }
private void PopulateListBoxWithFonts() { listBox1.set_Width(200); listBox1.set_Location(new Point(40, 120)); //foreach (FontFamily oneFontFamily in FontFamily.Families) for (int iCtr = 0; iCtr < FontFamily.get_Families().length; iCtr++) { FontFamily oneFontFamily = FontFamily.get_Families()[iCtr]; listBox1.get_Items().Add(oneFontFamily.get_Name()); } } //PopulateListBoxWithFonts
System.MarshalByRefObject
System.Drawing.FontFamily
プラットフォーム
Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
参照
- FontFamily クラスのページへのリンク