CListCtrl 控件显示乱码
2015-11-10 17:36
260 查看
需要手动修改控件的字体
如下:
[cpp] view plaincopy
LOGFONT lf;
memset(&lf,0,sizeof(LOGFONT));
lf.lfHeight = 12;
strcpy(lf.lfFaceName,"宋体");
HFONT hfont = ::CreateFontIndirect(&lf);
CFont* font = CFont::FromHandle(hfont);
m_listAllDevice.SetFont(font);
m_listAllDevice.InsertColumn(0, _T("编码"), LVCFMT_LEFT, 50);
m_listAllDevice.InsertColumn(1, _T("设备名称"), LVCFMT_LEFT, 100);
m_listAllDevice.InsertColumn(2, _T("IP地址"), LVCFMT_LEFT, 100);
m_listAllDevice.InsertColumn(3, _T("端口"), LVCFMT_LEFT, 50);
m_listAllDevice.InsertColumn(4, _T("用户名"), LVCFMT_LEFT, 80);
m_listAllDevice.InsertColumn(5, _T("密码"), LVCFMT_LEFT, 80);
m_listAllDevice.InsertColumn(6, _T("启用"), LVCFMT_LEFT, 50);
如下:
[cpp] view plaincopy
LOGFONT lf;
memset(&lf,0,sizeof(LOGFONT));
lf.lfHeight = 12;
strcpy(lf.lfFaceName,"宋体");
HFONT hfont = ::CreateFontIndirect(&lf);
CFont* font = CFont::FromHandle(hfont);
m_listAllDevice.SetFont(font);
m_listAllDevice.InsertColumn(0, _T("编码"), LVCFMT_LEFT, 50);
m_listAllDevice.InsertColumn(1, _T("设备名称"), LVCFMT_LEFT, 100);
m_listAllDevice.InsertColumn(2, _T("IP地址"), LVCFMT_LEFT, 100);
m_listAllDevice.InsertColumn(3, _T("端口"), LVCFMT_LEFT, 50);
m_listAllDevice.InsertColumn(4, _T("用户名"), LVCFMT_LEFT, 80);
m_listAllDevice.InsertColumn(5, _T("密码"), LVCFMT_LEFT, 80);
m_listAllDevice.InsertColumn(6, _T("启用"), LVCFMT_LEFT, 50);
相关文章推荐
- ajax.js
- MVCmoduleExample.html
- jquery easyui datagrid js获取记录数 页数 当前页
- httpRequest对象常用的方法
- 多线程
- pdsh、ClusterSSH和mussh集群管理软件
- 新启动线程时保存对象时报 错HibernateException: Illegal attempt to associate a collection with two open sessions
- jw player 配置参数
- 装饰模式与代理模式的区别
- Linux的man指令
- fullScreen.html
- android5.0_RecycleView初识
- OpenWRT USB 摄像头 配置网络摄像头
- 关于设置了setMaxAge(0)而浏览器未成功删除Cookie的注意事项
- MySQL Fabric 高可用性
- jq 某个时间段的倒计时
- setTimeout.js
- setInterval.js
- userDefineFunc.js
- To datafix AR DATE