您的位置:首页 > 其它

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);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: