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. Changing Size Font and Vertical Scroll Bar

Changing Size Font and Vertical Scroll Bar

Scheduled Pinned Locked Moved C / C++ / MFC
questionhelptutorial
2 Posts 2 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.
  • E Offline
    E Offline
    Eversman
    wrote on last edited by
    #1

    Hey all, I got 2 questions. 1st one is how do you change the size of a CString? I have tired and I couldn't get it, here is what I have tried. CFont font; font.CreatePointFont(480, "Arial", &dc); CString str("DEP"); CSize size = dc.GetTextExtent(str); dc.DrawText(str, printArea, DT_NOPREFIX | DT_WORDBREAK); 2nd question is how do you get a Veritcal Scroll Bar to work? I know how to add it to a Dialog, but can't get it to scroll. Thanks for the help

    G 1 Reply Last reply
    0
    • E Eversman

      Hey all, I got 2 questions. 1st one is how do you change the size of a CString? I have tired and I couldn't get it, here is what I have tried. CFont font; font.CreatePointFont(480, "Arial", &dc); CString str("DEP"); CSize size = dc.GetTextExtent(str); dc.DrawText(str, printArea, DT_NOPREFIX | DT_WORDBREAK); 2nd question is how do you get a Veritcal Scroll Bar to work? I know how to add it to a Dialog, but can't get it to scroll. Thanks for the help

      G Offline
      G Offline
      gUrM33T
      wrote on last edited by
      #2

      Before a call to the device context functions, you need to select the graphics object(s) you need to work with; in your case, a CFont object. Write the following statements before and after a call to the DrawText(...) function respectively: Before CFont *pOldFont = dc.SelectObject(&font); After dc.SelectObject(pOldFont); Gurmeet


      BTW, can Google help me search my lost pajamas?

      My Articles: HTML Reader C++ Class Library, Numeric Edit Control

      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