CListCtrl 控件显示乱码

需要手动修改控件的字体

 

如下:

 

[cpp] view plaincopy
 
  1. LOGFONT   lf;     
  2.     memset(&lf,0,sizeof(LOGFONT));                         
  3.     lf.lfHeight = 12;                                                       
  4.     strcpy(lf.lfFaceName,"宋体");                           
  5.     HFONT hfont = ::CreateFontIndirect(&lf);   
  6.     CFont* font = CFont::FromHandle(hfont);         
  7.     m_listAllDevice.SetFont(font);  
  8.       
  9.     m_listAllDevice.InsertColumn(0, _T("编码"),   LVCFMT_LEFT, 50);  
  10.     m_listAllDevice.InsertColumn(1, _T("设备名称"),   LVCFMT_LEFT, 100);  
  11.     m_listAllDevice.InsertColumn(2, _T("IP地址"), LVCFMT_LEFT, 100);  
  12.     m_listAllDevice.InsertColumn(3, _T("端口"), LVCFMT_LEFT, 50);  
  13.     m_listAllDevice.InsertColumn(4, _T("用户名"), LVCFMT_LEFT, 80);  
  14.     m_listAllDevice.InsertColumn(5, _T("密码"), LVCFMT_LEFT, 80);  
  15.     m_listAllDevice.InsertColumn(6, _T("启用"), LVCFMT_LEFT, 50);  

 

posted @ 2015-11-10 17:36  hxb316  阅读(631)  评论(0编辑  收藏  举报