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. Make text of CButton non-bold

Make text of CButton non-bold

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

    I am creating a new CButton programatically using following syntax : CButton *xtn; xbtn = new CButton(); xbtn->Create(... // relevant syntax My problem is text of the caption of button is always BOLD. I want it to be default-NON BOLD. I also tried getting a device context and then font and then LOGFONT ... change its weight property to 100 and then setting it as font of button's DC using selectobject() bt even that didnt work. Please help. -Cagespear

    N H 2 Replies Last reply
    0
    • C cagespear

      I am creating a new CButton programatically using following syntax : CButton *xtn; xbtn = new CButton(); xbtn->Create(... // relevant syntax My problem is text of the caption of button is always BOLD. I want it to be default-NON BOLD. I also tried getting a device context and then font and then LOGFONT ... change its weight property to 100 and then setting it as font of button's DC using selectobject() bt even that didnt work. Please help. -Cagespear

      N Offline
      N Offline
      Nishad S
      wrote on last edited by
      #2

      Use xbtn->SetFont( ...

      - NS -

      1 Reply Last reply
      0
      • C cagespear

        I am creating a new CButton programatically using following syntax : CButton *xtn; xbtn = new CButton(); xbtn->Create(... // relevant syntax My problem is text of the caption of button is always BOLD. I want it to be default-NON BOLD. I also tried getting a device context and then font and then LOGFONT ... change its weight property to 100 and then setting it as font of button's DC using selectobject() bt even that didnt work. Please help. -Cagespear

        H Offline
        H Offline
        Hamid Taebi
        wrote on last edited by
        #3

        You can change font of button with SetFont and also make your font with CreateFont and then use of it on the button.


        WhiteSky


        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