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. Change the bold effect when create a control.

Change the bold effect when create a control.

Scheduled Pinned Locked Moved C / C++ / MFC
c++question
7 Posts 5 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.
  • N Offline
    N Offline
    nguyenbinh07
    wrote on last edited by
    #1

    In the VC++, when we create a control (such as button, static,...), the text on this control should be bold. what can we do to make it to normal???

    _ S D M 4 Replies Last reply
    0
    • N nguyenbinh07

      In the VC++, when we create a control (such as button, static,...), the text on this control should be bold. what can we do to make it to normal???

      _ Offline
      _ Offline
      _AnsHUMAN_
      wrote on last edited by
      #2

      I think you are working in Win32. Did you try SetFont(/*params*/)

      Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_

      N 1 Reply Last reply
      0
      • _ _AnsHUMAN_

        I think you are working in Win32. Did you try SetFont(/*params*/)

        Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_

        N Offline
        N Offline
        nguyenbinh07
        wrote on last edited by
        #3

        X| X| X| Can you give me an example :)

        modified on Monday, September 22, 2008 4:47 AM

        _ 1 Reply Last reply
        0
        • N nguyenbinh07

          In the VC++, when we create a control (such as button, static,...), the text on this control should be bold. what can we do to make it to normal???

          S Offline
          S Offline
          shubhi
          wrote on last edited by
          #4

          If you are using win32 API, then - You can use CreateFont. Be sure the handle returned by CreateFont ( which you will use for the WM_SETFONT message ) is valid throughout the lifetime of the button window. If you want to make the font normal for all texts, then following may be helpful-

          HFONT hFont = (HFONT)GetStockObject(DEFAULT_GUI_FONT);
          SendMessage(hwnd, WM_SETFONT, (WPARAM)hFont, MAKELPARAM(TRUE, 0));

          It may be helpful, but not sure...... :-D

          "We can't solve problems by using the same kind of thinking we used when we created them"

          1 Reply Last reply
          0
          • N nguyenbinh07

            X| X| X| Can you give me an example :)

            modified on Monday, September 22, 2008 4:47 AM

            _ Offline
            _ Offline
            _AnsHUMAN_
            wrote on last edited by
            #5

            font.CreatePointFont (100,"Arial"); // TODO: Add your specialized creation code here RECT rect; rect.bottom = 100; rect.left = 0 ; rect.right =100; rect.top = 0; btn.Create ("MyButton",WS_CHILD|WS_VISIBLE,(const RECT &)rect,this,ID_BTN1); btn.SetFont(&font,false); font and button are both member variables of the class

            Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_

            1 Reply Last reply
            0
            • N nguyenbinh07

              In the VC++, when we create a control (such as button, static,...), the text on this control should be bold. what can we do to make it to normal???

              D Offline
              D Offline
              David Crow
              wrote on last edited by
              #6

              nguyenbinh07 wrote:

              the text on this control should be bold.

              What is it instead?

              "Love people and use things, not love things and use people." - Unknown

              "The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch

              1 Reply Last reply
              0
              • N nguyenbinh07

                In the VC++, when we create a control (such as button, static,...), the text on this control should be bold. what can we do to make it to normal???

                M Offline
                M Offline
                Mark Salsbery
                wrote on last edited by
                #7

                nguyenbinh07 wrote:

                should be

                Should be? YOU are responsible for setting the font if you want something different :)

                Mark Salsbery Microsoft MVP - Visual C++ :java:

                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