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 project font

Change the project font

Scheduled Pinned Locked Moved C / C++ / MFC
8 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
    Joe Smith IX
    wrote on last edited by
    #1

    Hi all, I am using VC6. Is there any easy way to make the font used in the dialog bold (MS Sans Serif)? Especially for all the CStatic's? I know I can simply use one of the CStatic-derived classes here, but that means I have to declare/initialize/set each member of the CStatic for all my dialogs! This means hundreds! Thanks for any input.

    PJ ArendsP D 2 Replies Last reply
    0
    • J Joe Smith IX

      Hi all, I am using VC6. Is there any easy way to make the font used in the dialog bold (MS Sans Serif)? Especially for all the CStatic's? I know I can simply use one of the CStatic-derived classes here, but that means I have to declare/initialize/set each member of the CStatic for all my dialogs! This means hundreds! Thanks for any input.

      PJ ArendsP Offline
      PJ ArendsP Offline
      PJ Arends
      wrote on last edited by
      #2

      In the dialog properties you can set the font for the dialog. That font will then be used by all the controls on the dialog.


      You may be right
      I may be crazy
      -- Billy Joel --

      Within you lies the power for good, use it!!!

      Within you lies the power for good; Use it!

      J 1 Reply Last reply
      0
      • J Joe Smith IX

        Hi all, I am using VC6. Is there any easy way to make the font used in the dialog bold (MS Sans Serif)? Especially for all the CStatic's? I know I can simply use one of the CStatic-derived classes here, but that means I have to declare/initialize/set each member of the CStatic for all my dialogs! This means hundreds! Thanks for any input.

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

        Joe Smith IX wrote:

        I know I can simply use one of the CStatic-derived classes here, but that means I have to declare/initialize/set each member of the CStatic for all my dialogs! This means hundreds!

        Just how hard is it to use the search/replace feature of the IDE?


        "Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

        "Judge not by the eye but by the heart." - Native American Proverb

        J 1 Reply Last reply
        0
        • PJ ArendsP PJ Arends

          In the dialog properties you can set the font for the dialog. That font will then be used by all the controls on the dialog.


          You may be right
          I may be crazy
          -- Billy Joel --

          Within you lies the power for good, use it!!!

          J Offline
          J Offline
          Joe Smith IX
          wrote on last edited by
          #4

          But as I mentioned in my original post, you can't make it BOLD from the properties, can you?

          PJ ArendsP 1 Reply Last reply
          0
          • D David Crow

            Joe Smith IX wrote:

            I know I can simply use one of the CStatic-derived classes here, but that means I have to declare/initialize/set each member of the CStatic for all my dialogs! This means hundreds!

            Just how hard is it to use the search/replace feature of the IDE?


            "Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

            "Judge not by the eye but by the heart." - Native American Proverb

            J Offline
            J Offline
            Joe Smith IX
            wrote on last edited by
            #5

            It's not hard at all to use search/replace. The problem I was referring to was that I would have to declare EACH and EVERY 'Static Text' as object, then initialize and set the properties of each one of them! Am I correct, or there is a much simpler way?

            D 1 Reply Last reply
            0
            • J Joe Smith IX

              But as I mentioned in my original post, you can't make it BOLD from the properties, can you?

              PJ ArendsP Offline
              PJ ArendsP Offline
              PJ Arends
              wrote on last edited by
              #6

              You did not mention that you tried it from the properties:doh: In VC8 it is possible to it from the properties, but not in VC6. I even tried modifying the dialog resource directly in the rc file by changing the FONT property. I was able to toggle the italic property but not change the weight. Another easy option is to use EnumChildWindows to enumerate through all your controls and send a WM_SETFONT message to each one.


              You may be right
              I may be crazy
              -- Billy Joel --

              Within you lies the power for good, use it!!!

              Within you lies the power for good; Use it!

              J 1 Reply Last reply
              0
              • PJ ArendsP PJ Arends

                You did not mention that you tried it from the properties:doh: In VC8 it is possible to it from the properties, but not in VC6. I even tried modifying the dialog resource directly in the rc file by changing the FONT property. I was able to toggle the italic property but not change the weight. Another easy option is to use EnumChildWindows to enumerate through all your controls and send a WM_SETFONT message to each one.


                You may be right
                I may be crazy
                -- Billy Joel --

                Within you lies the power for good, use it!!!

                J Offline
                J Offline
                Joe Smith IX
                wrote on last edited by
                #7

                thanks a lot. just what i was looking for.

                1 Reply Last reply
                0
                • J Joe Smith IX

                  It's not hard at all to use search/replace. The problem I was referring to was that I would have to declare EACH and EVERY 'Static Text' as object, then initialize and set the properties of each one of them! Am I correct, or there is a much simpler way?

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

                  Joe Smith IX wrote:

                  Am I correct...

                  No.

                  Joe Smith IX wrote:

                  ...there is a much simpler way?

                  Yes. Once you have a class derived from CStatic, simply change your dialog's .h file by renaming all references to CStatic to your derived class. In the derived class, see the Extras section of this article.


                  "Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

                  "Judge not by the eye but by the heart." - Native American Proverb

                  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