我正在使用从 Button 和 Label 派生的 CustomButton 和 CustomLabel。它们具有我需要的额外功能。
视觉差异很小,但我不知道 .NET 如何计算 Winforms 禁用的颜色。
最佳答案
您可以从 System.Drawing.SystemColors 中提取颜色。对于禁用控件上的标签或文本(例如),您需要等效的 COLOR_GRAYTEXT(来自 GetSysColor windows API),即 System.Drawing.SystemColors.GrayText。
请参阅 help for GetSysColor 中系统颜色的描述。
关于c# - 如何计算看起来非常接近 Winforms 控件的控件的禁用文本颜色?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1711737/