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. Changing font type in a View

Changing font type in a View

Scheduled Pinned Locked Moved C / C++ / MFC
question
6 Posts 5 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.
  • A Offline
    A Offline
    Anonymous
    wrote on last edited by
    #1

    In my SDI application I have to write some text in the View. I use TextOut function and it works fine using a Default font size and type (I suppose). I'd like to change font size and type. Is it possible ?? How ?? Thanks a lot !!!

    J C 2 Replies Last reply
    0
    • A Anonymous

      In my SDI application I have to write some text in the View. I use TextOut function and it works fine using a Default font size and type (I suppose). I'd like to change font size and type. Is it possible ?? How ?? Thanks a lot !!!

      J Offline
      J Offline
      jhwurmbach
      wrote on last edited by
      #2

      Could you use a CStatic for your Text? CP has plenty of information about CStatic.


      My opinions may have changed, but not the fact that I am right.

      A I 2 Replies Last reply
      0
      • J jhwurmbach

        Could you use a CStatic for your Text? CP has plenty of information about CStatic.


        My opinions may have changed, but not the fact that I am right.

        A Offline
        A Offline
        Anonymous
        wrote on last edited by
        #3

        My View is not a CFormView derived class. I'dont know if it is possible to create a CStatic control in a CView derived class. But I'd prefer to don't use a a CStatic control if it is possible... Text I have to draw changes continously position in my View and must be often created and destroyed so I think that it could be more easy to use TextOut function... But.. how to change font type and size ??? The only why is to create and manage CStatic controls ??

        1 Reply Last reply
        0
        • J jhwurmbach

          Could you use a CStatic for your Text? CP has plenty of information about CStatic.


          My opinions may have changed, but not the fact that I am right.

          I Offline
          I Offline
          ilgale
          wrote on last edited by
          #4

          I have followed your message... and I have created a CStatic control in my View. It can be good !!! So I can use a derived class from CStatic in order to change all parameters... Now, I have another problem... when my View is repainted the CStatic control is drawn again (I suppose) and it blinks. How can I solve this problem ?? Thanks a lot !!!

          C 1 Reply Last reply
          0
          • I ilgale

            I have followed your message... and I have created a CStatic control in my View. It can be good !!! So I can use a derived class from CStatic in order to change all parameters... Now, I have another problem... when my View is repainted the CStatic control is drawn again (I suppose) and it blinks. How can I solve this problem ?? Thanks a lot !!!

            C Offline
            C Offline
            Cedric Moonen
            wrote on last edited by
            #5

            You have to draw it first in memory and, when it's done, you push it on the screen. Use CreateCompatibleDC to create the memory dc compatible with the screen dc. Then draw your image on this device context, and, when it's done, send it to the screen dc using the BitBlt method (bitmap copy).

            1 Reply Last reply
            0
            • A Anonymous

              In my SDI application I have to write some text in the View. I use TextOut function and it works fine using a Default font size and type (I suppose). I'd like to change font size and type. Is it possible ?? How ?? Thanks a lot !!!

              C Offline
              C Offline
              Chintan
              wrote on last edited by
              #6

              Use SelectObject() API function giving second parameter as HFONT C.R.Naik

              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