CEditView Fonts

If you want to use your own font inside a CEditView you need to derive your own view adding

in the .h file

public:
 virtual void OnInitialUpdate();

and into the .cpp file

void CECMDView::OnInitialUpdate( )
{
  CEdit &rEdit = GetEditCtrl() ;
  CEditView::OnInitialUpdate();
  CClientDC dc(this);
  CFont* font=new CFont() ;
  font->CreatePointFont ( 100,_T("Times New Roman"), &dc ) ;
  SetFont ( font ) ;
}

Last modified on: September 11, 2008