In finishing off my Filter Control v1.1 I’ve been trying to sort a problem. If I deactivate a window where the canvas control has focus; the FocusRing doesn’t get cleared properly and I get the following left on my window…
Seems very similar to this bug left in feedback - 11396
Doing some debug seems to show that when I deactivate the window the canvas Paint event gets called twice, once with the Active property set to False and then immediately again with the Active flag set to True.
I haven’t seen that particular issue, but there’s a general problem with Canvas + FocusRing = very poor performance ( see <https://xojo.com/issue/26903> ) which could be related, if the underlying problem is “extra refresh events”?
Hey Pat, Assuming this control is a container, put a canvas behind the control parts, leaving enough border for the focus ring. On the Mac, Invalidate(true) to force an erase. On Windows, Invalidate(false) and don’t actually do any drawing – if Windows isn’t leaving the focus ring around.
You might have a border as integer computed property to help users position it properly.
Michael - Personally I think it’s more to do with 2 paint events getting fired but I’ll dig a bit deeper, I’ve appended a project to 11396 to get some Xojo Engineer feedback
Eugene - it’s only a problem on the Mac which really should have been pointed out on my original post!! I’ve had a play with these properties but didn’t seem to make a difference, could be I’ve missed something though. I’ll try again - cheers
Brad - Sorry Fella - the control is a canvas not a container …