From: Andrew Elder on 15 Apr 2010 19:01 Hi All, I am having a problem with a VB6 app not re-drawing the screen completely. This is a form that has not been changed (either form layout or code) for some time, but is now not re-drawing some controls...some command buttons in a frame are invisible. If I drag another app (eg Notepad) across this part of the form, the controls then re-appear. It appears that Windows is just "forgetting" to refresh this part of the screen! If I include a: Frame.Visible=False Frame.Visible=true in the code wherever any screen updates occur (I have several user-drawn graphs of data) then these controls will be visible, but this solution causes an annoying flash. I have searched the 'net but cannot find ant hints... Thanks in advance... Andrew Elder
From: David on 15 Apr 2010 22:23 Andrew: You didn't say whether you use AutoRedraw = True or whether you Paint everything yourself (AutoRedraw = False). My first guess is: 1) AutoRedraw on the form or some control got changed somewhere along the line. 2) Some code got changed or reordered. 3_ Review were you do your "Refresh". 4) If you use DoEvent quite a bit then this can cause issues. 5) If you don't use DoEvents at all then look at some key placement. Windows does its own thing when Painting, so tough to troubleshoot. About all I can offer without more info. David "Andrew Elder" <aelder(a)melbpc.org.au> wrote in message news:ej%239D%23O3KHA.4332(a)TK2MSFTNGP02.phx.gbl... > Hi All, > > I am having a problem with a VB6 app not re-drawing the screen completely. > This is a form that > has not been changed (either form layout or code) for some time, but is > now not re-drawing some > controls...some command buttons in a frame are invisible. If I drag > another app (eg Notepad) > across this part of the form, the controls then re-appear. It appears that > Windows is just "forgetting" > to refresh this part of the screen! > > If I include a: > Frame.Visible=False > Frame.Visible=true > in the code wherever any screen updates occur (I have several user-drawn > graphs of data) then these > controls will be visible, but this solution causes an annoying flash. > > I have searched the 'net but cannot find ant hints... > > Thanks in advance... > > Andrew Elder > >
From: Mike Williams on 16 Apr 2010 02:09 "Andrew Elder" <aelder(a)melbpc.org.au> wrote in message news:ej%239D%23O3KHA.4332(a)TK2MSFTNGP02.phx.gbl... > I am having a problem with a VB6 app not re-drawing the > screen completely. This is a form that has not been changed > for some time, but is now not re-drawing some controls... > some command buttons in a frame are invisible. If I drag > another app (eg Notepad) across this part of the form, the > controls then re-appear. It appears that Windows is just > "forgetting" to refresh this part of the screen! (I have > several user-drawn graphs of data) . . Is your code perhaps inadvertently drawing over the controls? I'm assuming that the actual graphs you are drawing are not temporarily covering them or you would surely notice, but it is possible under certain circumstances that something as simple as a Me.Cls is doing it. This would likely happen if, for example, you have accidentally set the ClipControls property of your Form, or perhaps of the Frame, to False. Have you checked that ClipControls is True in both cases? Mike
From: Jeff Johnson on 16 Apr 2010 13:38 "Andrew Elder" <aelder(a)melbpc.org.au> wrote in message news:ej%239D%23O3KHA.4332(a)TK2MSFTNGP02.phx.gbl... > I am having a problem with a VB6 app not re-drawing the screen completely. > This is a form that > has not been changed (either form layout or code) for some time, but is > now not re-drawing some > controls...some command buttons in a frame are invisible. If I drag > another app (eg Notepad) > across this part of the form, the controls then re-appear. It appears that > Windows is just "forgetting" > to refresh this part of the screen! > > If I include a: > Frame.Visible=False > Frame.Visible=true > in the code wherever any screen updates occur (I have several user-drawn > graphs of data) then these > controls will be visible, but this solution causes an annoying flash. > > I have searched the 'net but cannot find ant hints... Welcome to VB. This problem just seems to occur randomly. I have one program where it happens all the time in a certain group of list views. I don't know what to tell you. Have you tried calling Refresh on the controls themselves?
From: Andrew Elder on 16 Apr 2010 20:45 Hi All, Thanks for everyone's input. There where two refreshing problems on this particular form. 1. A standard Frame with several standard Command Buttons. The Command Buttons sometimes disappeared, or where partly drawn if forced to by dragging another app over them. 2. A Picturebox with graphic methods only partly drawing, leaving rectangles of light grey backgrounds. I cured the first problem by setting the Clipcontrols for the Frame to False. I still do not fully understand what this does, despite reading the help several time, but it seems to have fixed this one! The second problem "just got better"! I was tesing various combinations of Clipcontrols and Autoredraw, and it all started to work properly again. All settings are now back to when I wrote some of this code years ago. As Jeff suggested, it seems to be random. I have seen similar occurences over the years, and sometimes it can be cured by removeing the form from the project, attempting to compile (Run) the project, then adding the form back after the complier complains. I am guessing it's to do with the order in which the modules, forms etc are loaded into the project and compiled. Anyhow, it seems to work now, so I am happy. But, I don't fully understand what I did to fix it, so I am not happy! Thanks again...keep this forum alive forever... Andrew "Jeff Johnson" <i.get(a)enough.spam> wrote in message news:%23wYetuY3KHA.556(a)TK2MSFTNGP04.phx.gbl... > "Andrew Elder" <aelder(a)melbpc.org.au> wrote in message > news:ej%239D%23O3KHA.4332(a)TK2MSFTNGP02.phx.gbl... > >> I am having a problem with a VB6 app not re-drawing the screen >> completely. This is a form that >> has not been changed (either form layout or code) for some time, but is >> now not re-drawing some >> controls...some command buttons in a frame are invisible. If I drag >> another app (eg Notepad) >> across this part of the form, the controls then re-appear. It appears >> that Windows is just "forgetting" >> to refresh this part of the screen! >> >> If I include a: >> Frame.Visible=False >> Frame.Visible=true >> in the code wherever any screen updates occur (I have several user-drawn >> graphs of data) then these >> controls will be visible, but this solution causes an annoying flash. >> >> I have searched the 'net but cannot find ant hints... > > Welcome to VB. This problem just seems to occur randomly. I have one > program where it happens all the time in a certain group of list views. I > don't know what to tell you. Have you tried calling Refresh on the > controls themselves? > >
|
Next
|
Last
Pages: 1 2 Prev: What file extensions are considered to be executable? Next: Design Input Needed |