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 / C++ / MFC
  4. Owner Drawn Button

Owner Drawn Button

Scheduled Pinned Locked Moved C / C++ / MFC
comtutorial
4 Posts 3 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.
  • T Offline
    T Offline
    Timothy Grabrian
    wrote on last edited by
    #1

    I would like to paint a focus rect around the inside of my buttons, I can not figure out how to make a brush that is the text color every other pixel (like the standard windows buttons focus rect) wWw.KruncherInc.cOm

    A J 2 Replies Last reply
    0
    • T Timothy Grabrian

      I would like to paint a focus rect around the inside of my buttons, I can not figure out how to make a brush that is the text color every other pixel (like the standard windows buttons focus rect) wWw.KruncherInc.cOm

      A Offline
      A Offline
      Antony M Kancidrowski
      wrote on last edited by
      #2

      Take a look at CPen you can set its style to PS_DOT Ant. I'm hard, yet soft.
      I'm coloured, yet clear.
      I'm fruity and sweet.
      I'm jelly, what am I? Muse on it further, I shall return!
      - David Walliams (Little Britain)

      T 1 Reply Last reply
      0
      • A Antony M Kancidrowski

        Take a look at CPen you can set its style to PS_DOT Ant. I'm hard, yet soft.
        I'm coloured, yet clear.
        I'm fruity and sweet.
        I'm jelly, what am I? Muse on it further, I shall return!
        - David Walliams (Little Britain)

        T Offline
        T Offline
        Timothy Grabrian
        wrote on last edited by
        #3

        Oh, I'm sorry, I forgot to mention that this program is all WIN32 not MFC. wWw.KruncherInc.cOm

        1 Reply Last reply
        0
        • T Timothy Grabrian

          I would like to paint a focus rect around the inside of my buttons, I can not figure out how to make a brush that is the text color every other pixel (like the standard windows buttons focus rect) wWw.KruncherInc.cOm

          J Offline
          J Offline
          John R Shaw
          wrote on last edited by
          #4

          You'll need to call SetROP2() with the appropriate draw mode type then select a null brush into the DC so that Rectangle() will only draw the border of the rectangle without filling it. You could take a look at one of the custom button drawing articles to see how it is done. Yes I know they are using MFC, but the steps are exactly the same. Since MFC DC class is just a wrapper around the Win32 function calls with some additional functionality to help avoid a few steps, you should have no problem understanding what they are doing. Good Luck! INTP

          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