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. Control CStatic, Height of FONT

Control CStatic, Height of FONT

Scheduled Pinned Locked Moved C / C++ / MFC
c++tutorial
4 Posts 4 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.
  • D Offline
    D Offline
    durban2
    wrote on last edited by
    #1

    MFC, STUDIO 2008 How to increase height of text CStatic* pStatic = (CStatic*) GetDlgItem(IDC_STATIC2); CFont font; font.CreateFont(640, // 320 - same 0, // int nWidth, 0, 0, 400, FALSE, FALSE, 0, ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_ROMAN, L"Times New Roman"); // Do something with the font just created... pStatic->SetFont(font,1); pStatic->SetWindowTextW(L"Any text");

    H N 2 Replies Last reply
    0
    • D durban2

      MFC, STUDIO 2008 How to increase height of text CStatic* pStatic = (CStatic*) GetDlgItem(IDC_STATIC2); CFont font; font.CreateFont(640, // 320 - same 0, // int nWidth, 0, 0, 400, FALSE, FALSE, 0, ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_ROMAN, L"Times New Roman"); // Do something with the font just created... pStatic->SetFont(font,1); pStatic->SetWindowTextW(L"Any text");

      H Offline
      H Offline
      Hamid Taebi
      wrote on last edited by
      #2

      durban2 wrote:

      font.CreateFont(640, // 320 - same

      Why 640?

      Of one Essence is the human race thus has Creation put the base One Limb impacted is sufficient For all Others to feel the Mace (Saadi )

      1 Reply Last reply
      0
      • D durban2

        MFC, STUDIO 2008 How to increase height of text CStatic* pStatic = (CStatic*) GetDlgItem(IDC_STATIC2); CFont font; font.CreateFont(640, // 320 - same 0, // int nWidth, 0, 0, 400, FALSE, FALSE, 0, ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_ROMAN, L"Times New Roman"); // Do something with the font just created... pStatic->SetFont(font,1); pStatic->SetWindowTextW(L"Any text");

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

        Use following method for a try.

        CFont font;
        VERIFY(font.CreateFont(
        12, // nHeight
        0, // nWidth
        0, // nEscapement
        0, // nOrientation
        FW_NORMAL, // 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("Arial"))); // lpszFacename

        GetDlgItem(IDC_STATIC_TITLE)->SetFont(&font);

        studing is processing in this life.

        F 1 Reply Last reply
        0
        • N nyeboy

          Use following method for a try.

          CFont font;
          VERIFY(font.CreateFont(
          12, // nHeight
          0, // nWidth
          0, // nEscapement
          0, // nOrientation
          FW_NORMAL, // 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("Arial"))); // lpszFacename

          GetDlgItem(IDC_STATIC_TITLE)->SetFont(&font);

          studing is processing in this life.

          F Offline
          F Offline
          ForNow
          wrote on last edited by
          #4

          two things could I use to this code anywhere Or does it have to be in let's say ::OnInitDialig ::OnCtlColor Also I read that using SetFont I would have to process the WM_SETFONT Message Thanks

          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