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. Round Button

Round Button

Scheduled Pinned Locked Moved C / C++ / MFC
question
3 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.
  • J Offline
    J Offline
    john5632
    wrote on last edited by
    #1

    Hi, I am creating a ownder draw button with Round Edges. I tried the bolw code for round edged in OnDraw() //make round corner CRgn rgn; CRect crt; GetClientRect(&crt); rgn.CreateRoundRectRgn( crt.left, crt.top, crt.right, crt.bottom, 13, 13); SetWindowRgn(rgn,1); Button is coming with round edges but If button repaints it is becoming rectanglular shape button. What shall I do?

    S M 2 Replies Last reply
    0
    • J john5632

      Hi, I am creating a ownder draw button with Round Edges. I tried the bolw code for round edged in OnDraw() //make round corner CRgn rgn; CRect crt; GetClientRect(&crt); rgn.CreateRoundRectRgn( crt.left, crt.top, crt.right, crt.bottom, 13, 13); SetWindowRgn(rgn,1); Button is coming with round edges but If button repaints it is becoming rectanglular shape button. What shall I do?

      S Offline
      S Offline
      Software_Developer
      wrote on last edited by
      #2

      Below is a link to Chris Maunder's class that turns rectangular buttons into round buttons. Round Buttons[^]

      1 Reply Last reply
      0
      • J john5632

        Hi, I am creating a ownder draw button with Round Edges. I tried the bolw code for round edged in OnDraw() //make round corner CRgn rgn; CRect crt; GetClientRect(&crt); rgn.CreateRoundRectRgn( crt.left, crt.top, crt.right, crt.bottom, 13, 13); SetWindowRgn(rgn,1); Button is coming with round edges but If button repaints it is becoming rectanglular shape button. What shall I do?

        M Offline
        M Offline
        Mohan Ramachandra
        wrote on last edited by
        #3

        john5632 wrote:

        Button is coming with round edges but If button repaints it is becoming rectanglular shape button. What shall I do?

        I think your drawing the whole rectangular area of the button in OnDraw function. Draw only the round rectangular area of the button. OR Draw the button with the dialog background first and then draw the remaining things.

        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