开发者

How do I remove border around a custom CProgressCtrl?

I have created a custom progress control, derived from CProgressCtrl, to display the progress using a bitmap by overwriting the OnPaint function (CProgressCtrl::OnPa开发者_运维百科int is not called). When viewed in the application, there is a border around the progress bar. WS_BORDER is not set for the progress control, nor any other control that I can find within the application. Calling ModifyStyle(WS_BORDER, 0) on the progress control to remove the border returns 0 and does not change the appearance, while ModifyStyle(0, WS_BORDER) adds a second border around the progress bar.

WS_BORDER is definitely not set on this control, but there is clearly a Windows border around the control. Is it possible that the control is fully enclosed within another control as a child window, and if so how would I find this control and disable the WS_BORDER? Or is the border drawn automatically because the control is a derived class of CProgressCtrl even though OnPaint is overridden?


The progress control is a single window - this can easily be verified with Spy++.

I think you need to override OnNcPaint as well as OnPaint.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜