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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Using SetFont and Trying to Display PI(the symbol)

Using SetFont and Trying to Display PI(the symbol)

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
5 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
    J Guds
    wrote on last edited by
    #1

    I'm trying to display the PI symbol on certain static text variables in a Dialog box. I know I can set all the text in the dialog box to the symbol font but is there a way using SetFont in the OnInitDialog() function to allow me to change the only certain ones to the symbol PI? Also how would I put a subscript/superscript on a static text? Would this be done using some sort of RichEdit? Any help would be nice. J Guds Masters Student Kansas University

    E 1 Reply Last reply
    0
    • J J Guds

      I'm trying to display the PI symbol on certain static text variables in a Dialog box. I know I can set all the text in the dialog box to the symbol font but is there a way using SetFont in the OnInitDialog() function to allow me to change the only certain ones to the symbol PI? Also how would I put a subscript/superscript on a static text? Would this be done using some sort of RichEdit? Any help would be nice. J Guds Masters Student Kansas University

      E Offline
      E Offline
      Ellis Li
      wrote on last edited by
      #2

      CFont font; font.CreateFont( 14, // nHeight 0, // nWidth 0, // nEscapement 0, // nOrientation FW_BOLD, // nWeight FALSE, // bItalic FALSE, // bUnderline 0, // cStrikeOut ANSI_CHARSET, // nCharSet OUT_DEFAULT_PRECIS, // nOutPrecision CLIP_DEFAULT_PRECIS, // nClipPrecision DEFAULT_QUALITY, // nQuality DEFAULT_PITCH | FF_SWISS, // nPitchAndFamily _T("MS Sans Serif")); btn = (CButton*)GetDlgItem(IDC_BUTTON_EXIT); btn->SetFont(&font); Ellis Li

      E 1 Reply Last reply
      0
      • E Ellis Li

        CFont font; font.CreateFont( 14, // nHeight 0, // nWidth 0, // nEscapement 0, // nOrientation FW_BOLD, // nWeight FALSE, // bItalic FALSE, // bUnderline 0, // cStrikeOut ANSI_CHARSET, // nCharSet OUT_DEFAULT_PRECIS, // nOutPrecision CLIP_DEFAULT_PRECIS, // nClipPrecision DEFAULT_QUALITY, // nQuality DEFAULT_PITCH | FF_SWISS, // nPitchAndFamily _T("MS Sans Serif")); btn = (CButton*)GetDlgItem(IDC_BUTTON_EXIT); btn->SetFont(&font); Ellis Li

        E Offline
        E Offline
        Ellis Li
        wrote on last edited by
        #3

        1. Remember to delete your font after use. 2. This is only a sample, please custom it yourself Ellis Li

        E 1 Reply Last reply
        0
        • E Ellis Li

          1. Remember to delete your font after use. 2. This is only a sample, please custom it yourself Ellis Li

          E Offline
          E Offline
          Ellis Li
          wrote on last edited by
          #4

          why delete the font after you used the SetFont()? Please refer to : http://www.flounder.com/detach.htm Ellis Li

          D 1 Reply Last reply
          0
          • E Ellis Li

            why delete the font after you used the SetFont()? Please refer to : http://www.flounder.com/detach.htm Ellis Li

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

            Did you know that you could modify your original response instead of creating more?


            "The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)

            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