locked
combo box with all system fonts in metro style app RRS feed

  • Question

  • Hi,

    I'm building a metro style app with a Settings flyout. There, I want to insert a combobox with all system fonts listed so users can change the app font.

    How can I get all system fonts and list them in my combobox? The fonts namespace is changed and all the examples I saw are no longer valid.

    Thank you in advance.

    Merry Christmas and Happy New Year.

    Gabriele


    Gabriele

    • Moved by Mike Danes Thursday, December 27, 2012 5:43 PM WinStore specific (From:Visual C# )
    Tuesday, December 25, 2012 5:20 PM

Answers

All replies

  • Try this:

    foreach (FontFamily font in System.Drawing.FontFamily.Families)
    {
        comboBox1.Items.Add(font.Name);
    }


    Classified SR-2 | 2x Xeon W5580 - 3.20 GHz | 12x 2GB Kingston KHX2000C9D3T1K3/6GX | 2x MARS II/2DIS/3GD5 | SAMSUNG 830 MZ-7PC512D/AM 2.5" 512GB SATA III MLC | 4x Spinpoint F3EG HD503HI 500GB 5400 16MB SATA 3.0Gb/s |

    Tuesday, December 25, 2012 10:15 PM
  • Hi,

    thank you so much for your reply. I'm sorry for my delay.

    Ufortunately, the System.Drawing namespace is unavailable in metro apps. So I can't go along this way, I think.


    Gabriele

    Thursday, December 27, 2012 3:04 PM
  • I know this is not a all c# but inter-operates with c++ but here is how someone get a list of all fonts: http://geoffwebbercross.blogspot.com/2012/10/listing-font-names-in-windows-8-c-xaml.html.

    Also you question would be better suited for the: Building Windows Store apps with C# or VB forum.

    Thanks,

    Brad

    • Marked as answer by cybergabry Friday, December 28, 2012 6:05 PM
    Thursday, December 27, 2012 5:02 PM
  • You got the solution :)

    Thanks so much!

    Hope Microsoft solves the problem in a simpler way.


    Gabriele

    Friday, December 28, 2012 6:07 PM