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. Edit box

Edit box

Scheduled Pinned Locked Moved C / C++ / MFC
question
9 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
    Diglu
    wrote on last edited by
    #1

    How can I change the fonts of edit box. Thanks to all.

    N H S 3 Replies Last reply
    0
    • D Diglu

      How can I change the fonts of edit box. Thanks to all.

      N Offline
      N Offline
      Naveen
      wrote on last edited by
      #2

      Create a member variable( of control type ) for the edit control and call the SetFont funtion of that variable. nave

      1 Reply Last reply
      0
      • D Diglu

        How can I change the fonts of edit box. Thanks to all.

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

        CFont m_Font; m_Font.CreateFont(...); m_EditBox.SetFont(&m_Font);_**


        **_

        whitesky


        D 1 Reply Last reply
        0
        • D Diglu

          How can I change the fonts of edit box. Thanks to all.

          S Offline
          S Offline
          songlei
          wrote on last edited by
          #4

          uses WM_SETFONT

          1 Reply Last reply
          0
          • H Hamid Taebi

            CFont m_Font; m_Font.CreateFont(...); m_EditBox.SetFont(&m_Font);_**


            **_

            whitesky


            D Offline
            D Offline
            Diglu
            wrote on last edited by
            #5

            But It is Giving Debug Assertion Failed.. ----------------------------------- CFont font; 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 "Arial"); // lpszFacename m_Edit.SetFont(&font);// where m_Edit is: CEdit m_edit; ----------------------------------

            H 1 Reply Last reply
            0
            • D Diglu

              But It is Giving Debug Assertion Failed.. ----------------------------------- CFont font; 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 "Arial"); // lpszFacename m_Edit.SetFont(&font);// where m_Edit is: CEdit m_edit; ----------------------------------

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

              Whats Error?_**


              **_

              whitesky


              D 1 Reply Last reply
              0
              • H Hamid Taebi

                Whats Error?_**


                **_

                whitesky


                D Offline
                D Offline
                Diglu
                wrote on last edited by
                #7

                It is Giving Debug Assertion Failed.. NO Error. Assertion Failed.... for the line m_Edit.SetFont(... Where have to give this code " m_Edit.SetFont(... "

                H 1 Reply Last reply
                0
                • D Diglu

                  It is Giving Debug Assertion Failed.. NO Error. Assertion Failed.... for the line m_Edit.SetFont(... Where have to give this code " m_Edit.SetFont(... "

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

                  I dont know your error use from debugger but i write and i check this code not problem and it work please see, //in header file CEdit m_Edit2; CFont font; m_Edit2.Create(WS_CHILD|WS_VISIBLE,CRect(100,0,250,23),this,1); 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 m_Edit2.SetFont(&font);
                  test this code and answer to me it has error or it work_**


                  **_

                  whitesky


                  D 1 Reply Last reply
                  0
                  • H Hamid Taebi

                    I dont know your error use from debugger but i write and i check this code not problem and it work please see, //in header file CEdit m_Edit2; CFont font; m_Edit2.Create(WS_CHILD|WS_VISIBLE,CRect(100,0,250,23),this,1); 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 m_Edit2.SetFont(&font);
                    test this code and answer to me it has error or it work_**


                    **_

                    whitesky


                    D Offline
                    D Offline
                    Diglu
                    wrote on last edited by
                    #9

                    Yes the code is working; Thanks a lot.

                    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