即使被透明窗口遮挡,DataGridView 也会闪烁
我对 DataGridView 控件有疑问。在某些操作过程中,网格被半透明对话框覆盖(以向用户指示操作并防止用户按下按钮等)。在此期间网格更新频率约为 1Hz。在 Windows XP 下,DataGridView 控件偶尔会在屏蔽对话框上方“闪烁”一秒钟 - 没有足够的时间来实际执行任何操作,但仍然有点碍眼。我还注意到,在运行 Window 7 的开发计算机上,问题并未出现。我正在使用 .NET v3.5。任何帮助将不胜感激。
I have an issue with a DataGridView control. During certain operations, the grid is covered by a semi-transparent dialog (to indicate to users of the operation and prevent users from pressing buttons, etc.). The grid updates at about 1Hz during this time. Under Windows XP, the DataGridView control occasionally "flickers" above the masking dialog for a second - not enough time to actually do anything, but a bit of an eyesore nonetheless. I've also noticed that on my development machine, which runs Window 7, the problem doesn't show up. I'm using .NET v3.5. Any help would be appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Win32 窗体不透明度并不是真正的不透明度,而是其下方图像的副本。这是闪烁的原因,我还没有见过解决方法。
你的Win7问题也有它 - 但由于该机器和显卡处理速度更快,你实际上并没有看到重绘。
WPF 使用真正的不透明度,因此不会出现此问题。
Win32 Form opacity isn't real opacity - but a copy of the images beneath it. This is the cause of the flicker and not something I have ever seen a way to work around.
Your Win7 issue is also having it - but since that machine and graphic card process much faster, you aren't actually seeing the redraw.
WPF uses true opacity and as such will not have this problem.
我仅在使用 Xp 时遇到了奇怪的闪烁问题(尽管相似之处仅此而已)。以出现问题的形式尝试一下:
I had a strange flicker problem with Xp only (although that's where the similarities end). Give this a try in the form that's giving you the problem: