码迷,mamicode.com
首页 > 其他好文 > 详细

CListCtrl 控件显示乱码

时间:2015-11-10 19:19:58      阅读:203      评论:0      收藏:0      [点我收藏+]

标签:

需要手动修改控件的字体

 

如下:

 

[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);  

 

CListCtrl 控件显示乱码

标签:

原文地址:http://www.cnblogs.com/hxb316/p/4953771.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!