P
Peder Y
How can I set e.DrawFocusRectangle() correct in an owerdrawn
multiselect listbox?
I do all my drawing (e.g. OnMouseMove) calling OnDrawItem and
constructing the DrawItemEventArgs. The problem is that I never know
exactly when to draw the focus rectangle. The DrawFocusRectangle()
method is always called in the DrawItem event, but keeping track of
which DrawItemState needed to pass is hard work. I have a gut feeling
this can be done easier, but don't know how. It seems redundant that I
will need to pass on every time a mouse click is done or arrows or
pgup/dn/home/end etc are pressed. This info must be kept somewhere in
the listBox , I'm sure.
....when I invalidate the control, the win API kicks in and draws the
focusrectangle as it should be. Unfortunately, this is not an option
since it will cause a lot of flicker. I simply (?) need something to
test on (like an ideal Item.focused), so I can pass the proper
DrawItemEventArgs. Surely, someone must have bounced into problem
before...
Finally, is it possible to mark an item as both e.g. selected and
focused using an & operator or something?
- Peder -
multiselect listbox?
I do all my drawing (e.g. OnMouseMove) calling OnDrawItem and
constructing the DrawItemEventArgs. The problem is that I never know
exactly when to draw the focus rectangle. The DrawFocusRectangle()
method is always called in the DrawItem event, but keeping track of
which DrawItemState needed to pass is hard work. I have a gut feeling
this can be done easier, but don't know how. It seems redundant that I
will need to pass on every time a mouse click is done or arrows or
pgup/dn/home/end etc are pressed. This info must be kept somewhere in
the listBox , I'm sure.
....when I invalidate the control, the win API kicks in and draws the
focusrectangle as it should be. Unfortunately, this is not an option
since it will cause a lot of flicker. I simply (?) need something to
test on (like an ideal Item.focused), so I can pass the proper
DrawItemEventArgs. Surely, someone must have bounced into problem
before...
Finally, is it possible to mark an item as both e.g. selected and
focused using an & operator or something?
- Peder -