CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Guest

    How to change the font

    How to change the font of the CEditView?


  2. #2
    Guest

    Re: How to change the font

    You need to declare a CFont object and use the CreateFont function. The following example sets the font to 12 point Arial.
    [ccode]
    CFont fontText;
    fontText.CreateFont(12, 0, 0, 0, 400, FALSE, FALSE, 0, ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_SWISS, "Arial");

    //You then have to point the device context to the new font.

    CClientDC dc(this);
    dc.SelectObject(&fontText);


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured