INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Odd behaviour of labels using Windows7 64 bit

Odd behaviour of labels using Windows7 64 bit

(OP)
When I run a program (or test it in the IDE) in a Win7 64 bit computer (3 ghz I7), changing the text in a label or a rich text box causes the whole text line to annoyingly blink. When I run the same exe run in a Windows XP or an old slow Winm98 computer, changes to the text are instant with no gap.

To test this I added a 1 second timer and showed the time changing each second. About every 7 seconds I get no blink but all other second the whole label text blinks as it changes. The text appears to momentarily disappear before the new text is shown. In previous OSs the new text simply replaces the old text with no gap.

If i use a 2 line high rich text box and show the date on the top line and the time on the bottom line in one statement only the time line blinks as each second ticks by, the date line is steady. [Date() & vbcr & Time()]

Could this be something to do with the video card even though it is a fast one that shows HD video editing very well( Maybe the card and computer are too fast?

I have used 32 bit WIN7 in other computers before without this problem.
Compatibility mode makes no difference.
Colors of text and background make no difference.
Making the an identical test prog on an XP computer still blinks on the Win7 64 bit but not on the XP computer.

RE: Odd behaviour of labels using Windows7 64 bit

Sounds like a symptom of Desktop Composition.

As far as I know you'd need to use something like DirectX for rendering instead of the GDI-based controls. This has an impaact on lots of software, not just VB6 programs.


As an analogy, it is almost as if you were running an RDP client on the desktop that talks to the "real" desktop layer underneath that.

RE: Odd behaviour of labels using Windows7 64 bit

(OP)
Any suggestions as to how I should change it to Direct X if this is the case?

The computer has 2 ATI Radeon 5700 cards. Nowhere in the control panel or Catalyst control center is there a reference to Direct X or GDI options like I seem to remember I have seen in other card's control panels.
HD videos play perfectly so I suspect it is a VB6 related problem.

When I get a chance I'll try an different more simple video card from a 32bit machine.

RE: Odd behaviour of labels using Windows7 64 bit

Should be an easy thing to test.

If you are running Windows 7 you are still able to turn off desktop composition, see Disable Windows Aero | Windows 7, Vista.

Turn Aero off, then test your program. Turn it back on after testing.

If this is the problem there isn't much you can do aside from rewriting your program significantly to use a DirectX user interface instead of normal VB6 Forms and Controls which are based on the GDI rendering subsystem. This isn't practical because the DirectX wrappers VB6 needed were not produced past DirectX 7 (Windows XP).

Some alternative widget libraries use 3rd party rendering libraries such as Cairo. vbRichClient is one you could look at. I don't know whether this would solve your "blinking" issues.

RE: Odd behaviour of labels using Windows7 64 bit

There are some hacks that date back to VB3 that can be used. These haven't applied for a long time but conditions have changed to put VB at a disadvantage again.

See PRB: How to Prevent Flicker in the Repaint of a Label.

I think the problem involves synchronizing display updates with the refresh interval. This is where DirectX would come in for example. It has little to do with video hardware, but how Windows uses the hardware post-XP.

RE: Odd behaviour of labels using Windows7 64 bit

(OP)
Thanks.
I had tried everything suggested except the picture box method which works perfectly.

Strangely the ordinary label also works flicker free as long as you have a blank visible Picturebox and include Picturebox1.cls just before you update the label! No need to feed the date to the picturebox.

In future I'll just use the picturebox instead of the label for things like showing the time of day that change every second.

Another holy mystery as my sainted mother used to say when asked where do babies come from.

RE: Odd behaviour of labels using Windows7 64 bit

(OP)
Further.
I had the desktop set to non-aero because it interferes with using the IDE when designing forms but when I set to Aero, the blinking problem disappears on labels even without a picturebox.

RE: Odd behaviour of labels using Windows7 64 bit

Well keep in mind that Aero is gone post-Win7... er, or modified somewhat.

Seems WinRT XAML rendering had issues. So since "baby can't eat steak" we all get pablum now, even if we completely eschew the Metro travesty.

Just saying... be prepared for further disappointment.

RE: Odd behaviour of labels using Windows7 64 bit

Yes, good point. Must try out a VB6 app on W10 this afternoon

RE: Odd behaviour of labels using Windows7 64 bit

Well for testing this sort of thing you may need to have it installed on real hardware, not in a VM.

RE: Odd behaviour of labels using Windows7 64 bit

Hmmm. VirtualBox, which I'm using, has emulated the hardware the hardware necessary to support DWM properly since version 4.1.However, it is also fair to say that that requires the VirtualBox Guest Additions to be installed - and those have not been updated yet to work with W10

RE: Odd behaviour of labels using Windows7 64 bit

Now updated. DWM working as expected on W10 under VirtualBox

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close