ControlPaint.DrawReversibleFrame painting problem

  • Thread starter Thread starter Rao
  • Start date Start date
R

Rao

Hi,

Greetings.

I have used ControlPaint.DrawReversibleFrame to draw focus rectangle
on my custom drawn user control. All is fine and I can get the
toggling effect as that of ROP operations. When the control is
re-painted either because of re-size or some other form overlapping
it), the frame heavily flickers and some times the frame seems have
broken lines. Some times, the frame becomes invisible also. Did anyone
have this kind of problem with DrawReversibleFrame?

Thanks
 
* (e-mail address removed) (Rao) scripsit:
I have used ControlPaint.DrawReversibleFrame to draw focus rectangle
on my custom drawn user control. All is fine and I can get the
toggling effect as that of ROP operations. When the control is
re-painted either because of re-size or some other form overlapping
it), the frame heavily flickers and some times the frame seems have
broken lines. Some times, the frame becomes invisible also. Did anyone
have this kind of problem with DrawReversibleFrame?

Where exactly do you place the call to 'DrawReversibleFrame'? Are you
sure, you don't draw the frame over the previously drawn frame?
 
Thank you for quick reply.

I am doing this call in a method which is called whenever the user
clicks on some rectangular area of the control and this call results
in selection rectangle being drwan on the screen around that bouded
rectangle. Now when the user resizes the control or hides - activates
the control's client area, this call is again done in the control's
Paint event. What am I doing amiss here?
 
* (e-mail address removed) (Rao) scripsit:
I am doing this call in a method which is called whenever the user
clicks on some rectangular area of the control and this call results
in selection rectangle being drwan on the screen around that bouded
rectangle. Now when the user resizes the control or hides - activates
the control's client area, this call is again done in the control's
Paint event. What am I doing amiss here?

Try to remove the original rectangle before drawing the new one. In
other words: Draw the same rectangle again, then draw the new rectangle
at the appropriate position and size.
 
Back
Top