Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Reversible Frames on Windows Forms

Reversible Frames on Windows Forms

Scheduled Pinned Locked Moved C#
winformsquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • O Offline
    O Offline
    occcy
    wrote on last edited by
    #1

    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

    H 1 Reply Last reply
    0
    • O occcy

      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

      H Offline
      H Offline
      Heath Stewart
      wrote on last edited by
      #2

      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 new Color 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 the Control.Bounds property for the rectangle param of the DrawFocusRectangle method. If neither of these approaches is quite what you want, you can draw dotted lines by using a custom Pen with the Pen.DashStyle property set in calls to Graphics.DrawLine or Graphics.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-----

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups