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. Looking for a Edit box where i can set the font size.

Looking for a Edit box where i can set the font size.

Scheduled Pinned Locked Moved C / C++ / MFC
question
7 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.
  • W Offline
    W Offline
    whofmans
    wrote on last edited by
    #1

    Hi, I'm looking for an Edit box where i can set the font size something bigger. Do somebody know such of control?? Thanks, Willem

    D W 2 Replies Last reply
    0
    • W whofmans

      Hi, I'm looking for an Edit box where i can set the font size something bigger. Do somebody know such of control?? Thanks, Willem

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

      Yes, the Edit control is what you want. Just select a different font into its DC.

      W 1 Reply Last reply
      0
      • D David Crow

        Yes, the Edit control is what you want. Just select a different font into its DC.

        W Offline
        W Offline
        whofmans
        wrote on last edited by
        #3

        DavidCrow wrote: Yes, the Edit control is what you want. Just select a different font into its DC. okay, but how can i do that? thank you!

        RaviBeeR D B 3 Replies Last reply
        0
        • W whofmans

          DavidCrow wrote: Yes, the Edit control is what you want. Just select a different font into its DC. okay, but how can i do that? thank you!

          RaviBeeR Offline
          RaviBeeR Offline
          RaviBee
          wrote on last edited by
          #4

          Use SetFont(), which is a method of the base CWnd class. See the documentation of CFont before using this function. /ravi Let's put "civil" back in "civilization" http://www.ravib.com ravib@ravib.com

          1 Reply Last reply
          0
          • W whofmans

            DavidCrow wrote: Yes, the Edit control is what you want. Just select a different font into its DC. okay, but how can i do that? thank you!

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

            By using SetFont(): BOOL CMyDlg::OnInitDialog() { CDialog::OnInitDialog(); m_font.CreateStockObject(SYSTEM_FIXED_FONT); m_edit1.SetFont(&m_font); return TRUE; }

            1 Reply Last reply
            0
            • W whofmans

              DavidCrow wrote: Yes, the Edit control is what you want. Just select a different font into its DC. okay, but how can i do that? thank you!

              B Offline
              B Offline
              basementman
              wrote on last edited by
              #6

              create a font, and set the edit control to use it. The font object should be a member var in your dlg class. Method 1: --------- OnInitDialog() { ... m_oFont.CreatePointFont(80,"MS Sans serif"); m_oEditControl.SetFont(&m_oFont); ... } Method 2: --------- static LOGFONT BASED_CODE sEditFont = { -10, 0, 0, 0, FW_BOLD, 0, 0, 0, 0, OUT_STRING_PRECIS, CLIP_STROKE_PRECIS, DEFAULT_QUALITY, VARIABLE_PITCH|FF_SWISS, "Arial"}; OnInitDialog() { ... m_oFont.CreateFontIndirect(&sEditFont); m_oEditControl.SetFont(&m_oFont); ... }

              1 Reply Last reply
              0
              • W whofmans

                Hi, I'm looking for an Edit box where i can set the font size something bigger. Do somebody know such of control?? Thanks, Willem

                W Offline
                W Offline
                whofmans
                wrote on last edited by
                #7

                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