请问关于c的具体应用场景有哪些?
- 内容介绍
- 文章标签
- 相关推荐
本文共计1335个文字,预计阅读时间需要6分钟。
Winform主题实现没有BS那么优雅,下面做一个简单实现,记录一下。
1. 一个接口,需要实现主题的控件和窗口体。/// /// 使用主题的控件、窗口体需要实现此接口/// public interface IThemeableControl{ void ApplyTheme(); void UnapplyTheme();}
+2. 实现接口的控件和窗口体。// 控件实现public class ThemeableControl : Control, IThemeableControl{ public void ApplyTheme() { // 应用主题 }
public void UnapplyTheme() { // 取消应用主题 }}
// 窗体实现public class ThemeableForm : Form, IThemeableControl{ public void ApplyTheme() { // 应用主题 }
public void UnapplyTheme() { // 取消应用主题 }}
/// /// 使用主题的控件、窗口体需要实现此接口/// public interface IThemeableControl{ void ApplyTheme(); void UnapplyTheme();}
+3. 在窗体加载时应用主题。
本文共计1335个文字,预计阅读时间需要6分钟。
Winform主题实现没有BS那么优雅,下面做一个简单实现,记录一下。
1. 一个接口,需要实现主题的控件和窗口体。/// /// 使用主题的控件、窗口体需要实现此接口/// public interface IThemeableControl{ void ApplyTheme(); void UnapplyTheme();}
+2. 实现接口的控件和窗口体。// 控件实现public class ThemeableControl : Control, IThemeableControl{ public void ApplyTheme() { // 应用主题 }
public void UnapplyTheme() { // 取消应用主题 }}
// 窗体实现public class ThemeableForm : Form, IThemeableControl{ public void ApplyTheme() { // 应用主题 }
public void UnapplyTheme() { // 取消应用主题 }}
/// /// 使用主题的控件、窗口体需要实现此接口/// public interface IThemeableControl{ void ApplyTheme(); void UnapplyTheme();}
+3. 在窗体加载时应用主题。

