Wednesday, September 8, 2010

Bye Bye for SetRedraw( )

A common Classic PB code technique when modifying the displayed contents of window controls, is to turn off screen refresh by calling SetRedraw( false ), performing the update activity and then calling SetRedraw (true).

Setredraw( ) is one of those graphic object methods that falls by the wayside when migrating to .NET. It is no longer supported. Is this a bad thing that will give your users a migraine headache or a non-issue?

This post and the accompanying video will give you a refreshing understanding of the issue and help set your expectations when you migrate and see those unsupported feature warnings.

First some background:

In classic Windows UI and .NET WinForm, each window (and remember internally each control is a window) is constantly redrawing itself; when it's first created, when it's covered and re-exposed, and when something about its look and feel needs to change. When the application is told to paint itself (draw in PB terms), it works with an abstraction called a device context which is wrapped in a Graphics object. The context deals with the drawing surface as a field of colored dots which each of which it turns on in a color or off to match the request. The whole process is built upon the 1990's hardware and device driver technology that was current when MS Windows 3.x was designed Whew, I bet you're begin to get the feeling that constantly repainting a display during a dynamic refresh process is a lot of work for the application program!
Custom Search