CListCtrl 控件显示乱码
需要手动修改控件的字体
如下:
- 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);