Loss of Focus

It would appear that the venerable GDI routine "DrawFocusRect" and the MFC routine "DrawFocusRectangle" have lost a bit of functionality in their .net contemporary function "DrawFocusRectangle".
In the old world, you could draw the focus rectangle once to draw it, and then again to erase it because it uses an XOR pen to draw the familiar dashed box. Under the .net version "ControlPaint.DrawFocusRectangle", it doesn't use an XOR pen, so you can't erase it with another call.
There is a function called "DrawReversableFrame", that will erase itself, but it doesn't take a parameter containing the graphics object, so you have to manually transform the coordinates to screen coordinates.
A change like this is really not very understandable because it means that somebody had to create a function from scratch rather than wrapping the windows functions (as they did most of the time).


Popular posts from this blog

KnockoutJS, WebAPI, and TypeScript

The most efficient algorithm to scan a bitmap