简体   繁体   English

使用C#获取当前用户的Windows资源管理器字体大小

[英]Get windows explorer font size of current user using C#

Is this possible with C# or do I need to do P/Invoke? 使用C#是否可行,还是我需要进行P /调用? I was thinking it's an easy way to determine which font size to set for my ListView. 我当时想这是一种确定为ListView设置哪种字体大小的简便方法。

Check under class SystemFonts. 检查类SystemFonts下。 I don't think you need more than the default namespaces for this. 我认为您不需要更多的默认名称空间。

for example: 例如:

string name = SystemFonts.IconTitleFont.FontFamily.Name;
float size = SystemFonts.IconTitleFont.Size;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 C# Windows 窗体标签字体大小 - C# Windows Form label font size Windows C#字体大小计算 - Windows C# Font Size calcs 在 C# 守护进程服务中获取 Windows 当前登录用户 - Get Windows Current LoggedIn User in C# Daemon Service Windows Forms C# 应用程序 - 当用户为操作系统字体大小选择 125% 或 150% 时,设置表单控件的字体大小以适应屏幕? - Windows Forms C# application - Set font size of form controls to fit the screen when a user choose 125% or 150% for the OS font size? 使用 C# 的 Windows 资源管理器菜单 - Windows Explorer Menu using C# 使用 C# 在 Windows 10 中获取当前活动的应用程序名称 - Get current active application name in Windows 10 using C# 允许通过Active Directory用户使用C#访问文件夹,以及使用Windows资源管理器限制访问 - Allow access to folder using C# via Active Directory user and Restrict access using windows explorer C#FileSystemWatcher文件大小仅使用Windows资源管理器更新 - C# FileSystemWatcher file size is only updating with windows explorer 使用 C# 将字体大小应用于 iTextsharp PDF windows forms 时出错 - Error in applying font size to iTextsharp PDF windows forms using C# 如何使用C#安装Windows字体 - How to install a windows font using C#
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM