问题描述:

I just want to create a simple font chooser from button context menu so when I right click on the button it pops-up a list of all available system fonts.

网友答案:

http://msdn.microsoft.com/en-us/library/ms771765(v=vs.85).aspx

Have a look at that. It should give a good example of how to implement it a font selector.

网友答案:

This is how you get all system fonts...

System.Drawing.Text.InstalledFontCollection fonts = new System.Drawing.Text.InstalledFontCollection();
 for (int i = 0; i < fonts.Families.Length; i++)
 {
     Console.WriteLine(fonts.Families[i].Name);
 }

Then I would design user control for your font chooser and make it visible from the MouseRightButton_Down event of your button.

相关阅读:
Top