如何在c#中隐藏FontDialogbox的字体大小 [英] How to Hide Font Size from FontDialogbox in c#

查看:157
本文介绍了如何在c#中隐藏FontDialogbox的字体大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用c#.net

How to Remove Font Size from FontDialogbox in windows application using c#.net

推荐答案

抢救CodeProject从Windows应用程序中的FontDialogbox中删除字体大小:Hacking FontDialog:[ ^ ]。



但是,请注意,这是一个黑客,并且知道您将来可能遇到的兼容性问题。



如果您只想向用户显示字体,为什么不创建自己的自定义表单?使用类似ListBox的东西向用户显示可用的字体系列。您可以使用如下所示的代码轻松枚举字体系列:[ ^ ]。



其他资源:



微软在这里有一个自定义FontFialog for WPF的例子: [ ^ ],我假设您可以修改其内部字体大小和/或行为列表,以消除FontSize。要在Win Forms中重新创建这个,这将是一个高级问题,还有更多的工作,而不是必要的工作。



这里有一个开源可自定义的C#FontDialog: [ ^ ]。



我从未使用过上述两种资源中的任何一种,也绝不会使用。
CodeProject to the rescue: "Hacking FontDialog:" [^].

Be aware, however, that this is, as it states, a "hack," and who knows what compatibility problems you might encounter in the future.

If you only want to present the Fonts to the User, why not create your own custom Form ? Use something like a ListBox to present the available Font Families to the user. You can enumerate the Font Families easily using code like that shown here: [^].

Other Resources:

Microsoft has an example of a custom FontDialog for WPF here: [^], and I assume you could modify its internal list of font sizes, and/or behavior, to eliminate FontSize. To recreate this in Win Forms would be, imho, an advanced problem, and much more work than necessary.

There is an open-source customizable FontDialog for C# here: [^].

I have never used either of the above two resources, and never will.


这篇关于如何在c#中隐藏FontDialogbox的字体大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆