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. Different fonts in static controls

Different fonts in static controls

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

    Is there a way to force (or rather to ask :-) Windows to use different fonts in certain controls? In the actual case, I'd like to have a title or whatever with large letters in the main window area. I changed the font size parameter definition in the dialog resource definition, but this applies of course to all controls. I thought of overlaying the designated area with another windon containing the text, but a) I don't see, how to make a window without any border, etc. b) the wizzard changes the font size back again and again. Pls don't suggest to make a bit-map image out of my text :-( - that is the very last resort.

    T B V 3 Replies Last reply
    0
    • V Vancouver

      Is there a way to force (or rather to ask :-) Windows to use different fonts in certain controls? In the actual case, I'd like to have a title or whatever with large letters in the main window area. I changed the font size parameter definition in the dialog resource definition, but this applies of course to all controls. I thought of overlaying the designated area with another windon containing the text, but a) I don't see, how to make a window without any border, etc. b) the wizzard changes the font size back again and again. Pls don't suggest to make a bit-map image out of my text :-( - that is the very last resort.

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

      Have you looked at CWnd::SetFont? I have never attempted to change the fonts of different controls but I have done it only with one control. I see no difference though. // Afterall I realized that even my comment lines have bugs

      1 Reply Last reply
      0
      • V Vancouver

        Is there a way to force (or rather to ask :-) Windows to use different fonts in certain controls? In the actual case, I'd like to have a title or whatever with large letters in the main window area. I changed the font size parameter definition in the dialog resource definition, but this applies of course to all controls. I thought of overlaying the designated area with another windon containing the text, but a) I don't see, how to make a window without any border, etc. b) the wizzard changes the font size back again and again. Pls don't suggest to make a bit-map image out of my text :-( - that is the very last resort.

        B Offline
        B Offline
        BhaskarBora
        wrote on last edited by
        #3

        1. get the ctrl obj address 2. call SetFont function e.g: (if thats a CButton ctrl) CFont m_TEFont; CButton *ptr = (CButton *)GetDlgItem(IDC_BUTTON1); ptr->CreatePointFont(100,"Courier New"); ptr->SetFont(&m_TEFont,TRUE); "Think big, think fast, think ahead. Ideas are no one's monopoly"

        1 Reply Last reply
        0
        • V Vancouver

          Is there a way to force (or rather to ask :-) Windows to use different fonts in certain controls? In the actual case, I'd like to have a title or whatever with large letters in the main window area. I changed the font size parameter definition in the dialog resource definition, but this applies of course to all controls. I thought of overlaying the designated area with another windon containing the text, but a) I don't see, how to make a window without any border, etc. b) the wizzard changes the font size back again and again. Pls don't suggest to make a bit-map image out of my text :-( - that is the very last resort.

          V Offline
          V Offline
          Vancouver
          wrote on last edited by
          #4

          Thanks guys, I will try it. Actually, I created a few "buttons" as bit-maps. It's a bit tiresome, but this way one can do anything - for example big letters and underneath small explanation, all in color, on the "button". However this "button" does not act as a real button, so I created overlay-bitmaps, which show a different state of the buttons (it does not show the button being clicked, i.e. pressed down, but it indicates, that this has been selected). Anyway, I find it a bit sad to have to work so much for such trivias.

          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