C# 完美解决窗体切换闪屏问题
来源:互联网 发布:smaat7软件下载mac 编辑:程序博客网 时间:2024/05/21 14:50
完美解决窗体切换闪屏问题
将以下代码块加在父窗体中的任意位置
protected override CreateParams CreateParams
{
get
{
CreateParams cp = base.CreateParams;
cp.ExStyle |= 0x02000000;
return cp;
}
}
原理很简单,引用以下原话:
A form that has a lot of controls takes a long time to paint. Especially the Button control in its default style is expensive. Once you get over 50 controls, it starts getting noticeable. The Form class paints its background first and leaves "holes" where the controls need to go. Those holes are usually white, black when you use the Opacity or TransparencyKey property. Then each control gets painted, filling in the holes. The visual effect is ugly and there's no ready solution for it in Windows Forms. Double-buffering can't solve it as it only works for a single control, not a composite set of controls.
I discovered a new Windows style in the SDK header files, available for Windows XP and (presumably) Vista: WS_EX_COMPOSITED. With that style turned on for your form, Windows XP does double-buffering on the form and all its child controls.
- C# 完美解决窗体切换闪屏问题
- C# 完美解决窗体切换闪屏问题
- 完美解决程序启动,Activity之间切换,黑屏问题
- C#窗口切换问题的解决
- C#解决MDI窗体闪屏的方法
- C#解决MDI窗体闪屏的方法
- C#解决MDI窗体闪屏的方法
- C#解决MDI窗体闪屏的方法
- 【转】C#解决MDI窗体闪屏的方法
- 解决MDI窗体最大化状态小切换窗体时闪烁问题
- C#窗体退出出现两次确认bug本菜鸟已完美解决
- C# 解决窗体闪烁
- C#多线程解决界面卡死问题的完美解决方案
- 完美解决C# DataGridView控件显示不同表的问题
- C#多线程解决界面卡死问题的完美解决方案
- android 启动白屏问题完美解决
- 通过设置子窗体透明度,解决C# winform 子窗体设置背景图卡的问题
- C#子窗体进行数据操作后关闭,父窗体藏到后面问题的解决
- C#中splitContainer用法
- hdojSky数
- 第一次做面试官
- 动态创建sql数据表的执行语句
- 嵌入式开发要学习哪些知识
- C# 完美解决窗体切换闪屏问题
- 随笔
- c#初级篇-给所有的单词加上双引号
- 微信公众平台之超简单实用的天气预报后台实现
- tomcat源码分三----tomcat中的主要组件分析
- 这才是一个完整的用户登录(Forms身份认证+记住密码+加密存储+LoginedPage/BasePage)
- 帮女票写的C++小程序3
- 二叉树的非递归创建
- 基于Android智能电视的应用程序的布局