Paint problem.
-
I have an MFC dialog app that has a Webbrowser object in it. I put a bitmap as a background to that application and now whenever something covers my dialog app, the webbrowser control doesn't get redrawn. How can I fix this problem? This is probably an easy question for many of you to solve, but embarrassingly it has left me scratching my head for the last half-hour. Your help in answering my question will be greatly appreciated. Thanks in advance. :-)
-
I have an MFC dialog app that has a Webbrowser object in it. I put a bitmap as a background to that application and now whenever something covers my dialog app, the webbrowser control doesn't get redrawn. How can I fix this problem? This is probably an easy question for many of you to solve, but embarrassingly it has left me scratching my head for the last half-hour. Your help in answering my question will be greatly appreciated. Thanks in advance. :-)
I stumbled across an MSDN entry recently about something like this but I can't seem to find it now... :-( IIRC, the problem was related to the control's or the parent window's style not being set properly - you needed to add or remove WS_CLIPCHILDREN or WS_CLIPSIBLINGS. Something like that. Sorry for being so vague. HTH.
You should save yourself and your company years of grief by shooting yourself through the head immediately. Believe me, in the long run it'll turn out better for everyone. - Tyto (at arstechnica) Awasu 1.0[^]: A free RSS reader with support for Code Project.
-
I have an MFC dialog app that has a Webbrowser object in it. I put a bitmap as a background to that application and now whenever something covers my dialog app, the webbrowser control doesn't get redrawn. How can I fix this problem? This is probably an easy question for many of you to solve, but embarrassingly it has left me scratching my head for the last half-hour. Your help in answering my question will be greatly appreciated. Thanks in advance. :-)
I think the problem is the dialog has the CS_HREDRAW and CS_VREDRAW styles by default. In CDialog::PreCreateWindow register a new class without these styles. This will prevent the erasing of the entire window which is what these flags do when you move the window or some window comes on top. Now your browser control should hopefully stop behaving nastily :-) Nish
Author of the romantic comedy Summer Love and Some more Cricket [New Win] Review by Shog9 Click here for review[NW]