VC 2008中的状态栏和工具栏闪烁 [英] Statusbar and Toolbar Flicker in VC 2008

查看:66
本文介绍了VC 2008中的状态栏和工具栏闪烁的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近,我在VC 2008 Windows程序的主窗口中添加了状态栏和工具栏.我注意到滚动条是scrollint这些子窗口,所以我在主窗口的窗口样式规范中包括了WS_CLIPCHILDREN,但是随后我注意到,当主窗口位于调整大小.

因此,在主窗口的窗口过程为WM_SIZE的情况下,我将WM_SIZE 消息发送至工具栏和状态栏窗口.这似乎解决了问题,但同时也引入了闪烁的问题.

每次通过拖动其边框来调整主窗口的大小时,状态栏和工具栏都会闪烁.如何解决此问题?

Recently, I added a status bar and a toolbar to the main window of my VC 2008 windows program. I noticed that the scroll bar ws scrollint these child window so I included a WS_CLIPCHILDREN to the main window''s window style specification, but then I noticed the tool bar and the stutus bar don''t resize when the main window is resized.

So in the WM_SIZE case of my main window''s window procedure, I send WM_SIZE messages to the tool bar and status bar window. This seem to solve the problem but also introduced the problem is flickering.

Each time the main window is resized by dragging its border, the status bar and the tool bar flickers. How do I solve this problem?

推荐答案



这应该有帮助:
1在调整大小时进行绘画时,从主窗口中删除CS_HREDRAW和CS_VREDRAW 类样式 [ ^ ].
2在主窗口和子窗口中处理WM_ERASEBKGND(不执行任何操作,然后返回1).

欢呼声,
AR
Hi,

This should help:
1 As you handle painting on resizing, remove CS_HREDRAW and CS_VREDRAW from your main window Class Styles[^].
2 Handle WM_ERASEBKGND (do nothing and return 1) in your main and children windows.

cheers,
AR


这篇关于VC 2008中的状态栏和工具栏闪烁的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆