Reversible Frames on Windows Forms
-
Hello! I want to draw a reversible frame on my windows form. I have found the method ControlPaint.DrawReversibleFrame, but this method is not, what I'm looking for. I need a dotted frame like a fokus rectangle. Is there somebody who can tell me, how I can draw such a frame or how I can draw dashed lines with a XOR combination of colors? :confused: Thanks Björn
-
Hello! I want to draw a reversible frame on my windows form. I have found the method ControlPaint.DrawReversibleFrame, but this method is not, what I'm looking for. I need a dotted frame like a fokus rectangle. Is there somebody who can tell me, how I can draw such a frame or how I can draw dashed lines with a XOR combination of colors? :confused: Thanks Björn
If you need a focus rectangle, why not use
ControlPaint.DrawFocusRectangle
? You can specify both the foreground and background colors. If you need to invert the colors, you can create a newColor
by XOR'ing each of the R, G, and B components with 0 or 0xfff. If you want to draw a rectangle around the bounds of the control itself use theControl.Bounds
property for therectangle
param of theDrawFocusRectangle
method. If neither of these approaches is quite what you want, you can draw dotted lines by using a customPen
with thePen.DashStyle
property set in calls toGraphics.DrawLine
orGraphics.DrawRectangle
and similar methods.-----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----