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. CButton text alignment problem

CButton text alignment problem

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

    I have a button control on a dialog. The caption is quite long, so I set the multiline property to true. The caption is centered in the button at design time, but at run time, if the display is set to Windows Classic theme, the caption appears left aligned, regardless of what value I put for the Horizontal Alignment property. What could be the problem?

    T 1 Reply Last reply
    0
    • S Shree

      I have a button control on a dialog. The caption is quite long, so I set the multiline property to true. The caption is centered in the button at design time, but at run time, if the display is set to Windows Classic theme, the caption appears left aligned, regardless of what value I put for the Horizontal Alignment property. What could be the problem?

      T Offline
      T Offline
      toxcct
      wrote on last edited by
      #2

      Shree wrote:

      What could be the problem?

      no problem, it's how the CButton class is designed. how do you want it to behave like ?

      S 1 Reply Last reply
      0
      • T toxcct

        Shree wrote:

        What could be the problem?

        no problem, it's how the CButton class is designed. how do you want it to behave like ?

        S Offline
        S Offline
        Shree
        wrote on last edited by
        #3

        Since the text appears centered during design time, I would naturally expect it to appear centered during run time. Why does it become left aligned, and only when the text does not fit in one line, and only in the Windows classic theme? Or if the text should appear left aligned by design, how can I get it to appear centered?

        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