View refresh problem 
Author Message
 View refresh problem

I have an MDI application.  One of my functions opens a dialog box (lets
call it A), within that dialog a second dialog box (B) will open if the user
chooses a certain item. My problem is that when dialog B is destroyed the
client area of the parent window does not refresh leaving the bottom of
dialog B below dialog A. When dialog A is destroyed the remains of dialog B
is still there until something causes the client area to be repainted.  How
can I fix this?
Thanks!
Mark F.


Sun, 30 Mar 2003 03:00:00 GMT  
 View refresh problem

Quote:

> I have an MDI application.  One of my functions opens a dialog box (lets
> call it A), within that dialog a second dialog box (B) will open if the user
> chooses a certain item. My problem is that when dialog B is destroyed the
> client area of the parent window does not refresh leaving the bottom of
> dialog B below dialog A. When dialog A is destroyed the remains of dialog B
> is still there until something causes the client area to be repainted.  How
> can I fix this?
> Thanks!
> Mark F.

When dialog B is destroyed every window that it was covering receives the
WM_PAINT message.  That should cause the client area to be repainted.  If it is
your client area then your code must repaint it when the WM_PAINT message
occurs.  In an MFC view window this means do the painting in OnDraw.  Any
painting you do outside of OnDraw will have this problem of not restoring when
the window is uncovered.

--
Scott McPhillips [VC++ MVP]



Sun, 30 Mar 2003 03:00:00 GMT  
 View refresh problem
Scott,


Quote:


> > I have an MDI application.  One of my functions opens a dialog box (lets
> > call it A), within that dialog a second dialog box (B) will open if the
user
> > chooses a certain item. My problem is that when dialog B is destroyed
the
> > client area of the parent window does not refresh leaving the bottom of
> > dialog B below dialog A. When dialog A is destroyed the remains of
dialog B
> > is still there until something causes the client area to be repainted.
How
> > can I fix this?
> > Thanks!
> > Mark F.

> When dialog B is destroyed every window that it was covering receives the
> WM_PAINT message.  That should cause the client area to be repainted.  If
it is
> your client area then your code must repaint it when the WM_PAINT message
> occurs.  In an MFC view window this means do the painting in OnDraw.  Any
> painting you do outside of OnDraw will have this problem of not restoring
when
> the window is uncovered.

When dialog A is destroyed the client area is repainted normally. I think
its my video card, because I am getting "ghosts" in other apps as well.
Photoshop left a shadow of a dialog behind for a few seconds while it was
loading.

- Show quoted text -

Quote:

> --
> Scott McPhillips [VC++ MVP]



Mon, 31 Mar 2003 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. View refresh problem.

2. Class View refreshing

3. Refreshing the View?

4. Class View Refresh

5. View not being refreshed

6. How to refresh a view in mfc?

7. Window does nto refresh it's view

8. refreshing views in splitter window

9. Automatic, periodoc view refresh

10. automatically refreshing the view after updating the document size

11. Refreshing the View?

12. Refreshing a view

 

 
Powered by phpBB® Forum Software