views:

124

answers:

1

There are certainly some advantages in having a selection rectangle highlighting the currently selected element which also has the focus. However an element with padding can cause the rectangle to be drawn on a totally unwanted position and therefore is hindering and not helpful. So without further ado my question is: Is there a way to hide this rectangle OR adjust its position?

  • Switching over to ownerdrawing the whole element should be only the last resort
  • Setting the "TabStop" property to false is not working
A: 

In the objects onfocus event, set focus to the next item in the tab stop?

That will keep the control from ever getting focus, which will prevent the "system carat" from showing.

Neil N
Not bad. I just tried to override the OnGotFocus event and gave the parent the focus. It worked. With a little tweaking it should be possible to get the "next" child or the first child the focus, if my linklabel is the last element. Anyway, it would be nice for all the keyboard guys to allow this element to get the focus and just draw the rectangle at the correct position. The interesting thing is that doing the ownerdrawing for a linklable is very trivial and could be a valid alternative or just embedding it in another control and avoid padding, but maybe we find something more elegant.
merkuro