Link to home
Start Free TrialLog in
Avatar of MERCOMMS

asked on

Refresh screen

I have an app that opens a command prompt window then moves that command prompt window.  Everything works fine but after the command prompt window is moved there is a "ghost" of the window where it originally was.  If you grab the command prompt window and move it around it will erase the ghost of itself if that makes sense.  

What I need is something that will refresh the screen to get rid of the "ghost" image of the command prompt window (vb6).
Avatar of Element1910
Flag of United States of America image

Is it creating a ghost copy every time you move it or only once?
Avatar of MERCOMMS


I only move it via code one time and it doesn't create the ghost then but instead leaves a ghost of where it was originally.  Then if I grab the window I can use it kind of like an eraser to erase the ghost.
Avatar of Martin Liss
Does the same thing happen if the code is run in the IDE? If NOT then try putting a DoEvents line after the code that moves the window.
Doevents after moving the window has no affect.
Try to set Form AutoRedraw property to True.
Does it only happen with the exe?
Is your app by chance waiting for the command prompt window to close?

How are you opening that command prompt?
Avatar of shorvath
Flag of Canada image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial