Discussion Locked

VB 6 forms flutter

0 helpful
9 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

We have developed a program using VB6. We have a problem with some of the windows that cause fluttering. We have solved the problem by unloading the window before loading the next window but we need a better solution.

This is what happens. We have 3 windows 1, 2, 3.
If we load window 1 nothing unusual happens. Leaving 1 open we load 2 and nothing unusual happens. Leaving 1 and 2 open we load 3 and rapid fluttering occurs between the windows and the program hangs.

Any suggestion would be appreciated.

Ivan

9 replies

by ivancarr

The program loads the main.frm (the MDI form). All other forms are loaded within main.frm and are MDIChild. The flutter occurs when a child-A form is loaded and visible while child-B form is loaded (child-B.ZOrder set to 0)
and placed on top of child-A. The flutter is the result which is that the focus goes between child-A and child-B indefinitely. The goal is to have the focus on child-B form, the top form only.

by tony hopkinson

Guesses from your description.
Have you got code in formactivate which is causing the focus switch or deity forfend formpaint.
P.S. Form 1 is loading 2 & 3 isn't it ? You haven't got 2 loading 3 using windows MDI (which is nasty horrible limited pig of thing by the way).

by chucksomerville

Is there code in your 3rd window's load event to somehow try to bring the 1st window back to the front? Perhaps that's done in such a way that it triggers form 1's load event? (Causing you to go through the cycle again)?

by bschaettle

I know this is an extreme kludge, but try writing to a log file every time a form gets the focus. You can start to track down what's causing the focus to shift from form to form.

by tank252ca

Sounds like you have an infinite loop where the loading of child form B is triggering something in child form A. Have a look at the code in Activate, GotFocus, Initialize, Load and LostFocus events for the child forms. Is it possible that with setting the zorder of form B to 0, you have the zorder of both forms A and B being 0? Make sure that you change the zorder of both forms, or simply use the .visible and .setfocus properties for form B which will change the zorder automatically.

by martyconnelly

I don't know if this will help but there is a common problem with Access 2003 and WinXP on subforms with tab and label flicker.

You ain't gonna believe this but if running WinXP change your theme by right-clicking your Windows XP desktop, choosing Properties, and
setting the Theme to "Windows Classic".
If you cannot solve it then try deselecting Use Windows Themed Controls
on Forms under Tools | Options | Forms/Reports in Access 2003 the flickering or flutter goes away on my machine using Win XP Theme Classic and Access 2003 and by deselecting above option. The flickering is triggered by unattached labels on the page of a tab control. The workaround is to convert these labels to text boxes.
For non english speakers I found this by google searching on Screen
Flutter rather than Flicker.

For full explanation. and code to correct all forms if above tools option method doesn't work
http://members.iinet.net.au/~allenbrowne/ser-46.html

This discussion is closed to new replies.