I'm trying to create a combobox and populate it with a list of all fonts available in the system. I had a look at this topic-->Fill ComboBox with List of available Fonts and I found the following code in C#:
List<string> fonts = new List<string>();
foreach (FontFamily font in System.Drawing.FontFamily.Families)
{
fonts.Add(font.Name);
}
I tried to convert it to something like this in C++/CLI:
List<string> fonts = gcnew List<string>();
foreach (FontFamily font in System::Drawing::FontFamily::Families)
{
fonts->Add(font->Name);
}
But it didn't work. Can someone help me convert that C# code to C++/CLI?