热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

CListCtrl::InsertColumn为什么显示不出来

BOOLCNjtc_studentDlg::OnInitDialog(){CDialog::OnInitDialog();AddAboutmenuitemto
BOOL CNjtc_studentDlg::OnInitDialog()
{

CDialog::OnInitDialog();
// Add "About..." menu item to system menu.
    
// IDM_ABOUTBOX must be in the system command range.
ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
ASSERT(IDM_ABOUTBOX < 0xF000);

CMenu* pSysMenu = GetSystemMenu(FALSE);
if (pSysMenu != NULL)
{
CString strAboutMenu;
// CreateMenu();
strAboutMenu.LoadString(IDR_MENU1);
if (!strAboutMenu.IsEmpty())
{
pSysMenu->AppendMenu(MF_SEPARATOR);
pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
}
}

// Set the icon for this dialog.  The framework does this automatically
//  when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon

// TODO: Add extra initialization here
    InitDialog();//初始化对话框
return TRUE;  // return TRUE  unless you set the focus to a control


}
void CNjtc_studentDlg::InitDialog()
{
m_nListMember.SetExtendedStyle(LVS_EX_FULLROWSELECT | LVS_EX_HEADERDRAGDROP
| LVS_EX_GRIDLINES | LVS_EX_ONECLICKACTIVATE | LVS_EX_UNDERLINEHOT);
m_nListMember.InsertColumn(0,"Name",LVCFMT_CENTER,50);
m_nListMember.InsertColumn(1,"IP",LVCFMT_CENTER,50);
m_nListMember.InsertColumn(2,"LoginTime",LVCFMT_CENTER,50);

}
m_nListMember是我给控件设置的一个对象变量,但是,插入列之后,显示不出来,希望高手给小弟指点,谢谢!!!
还望哪未好心高手在以后的学习中指导我!谢谢!我的QQ 308378975

7 个解决方案

#1


看看InsertColumn的返回值是什么,用GetLastError找下错误

#2


你选择的样式是不是默认的”Icon"呀,应该选择“Report"样式吧
在它的属性窗口中,将STYLE 属性页中的 View下拉框中选择 “Report"样式试试

#3


谢谢大哥门!就是2楼的大哥说的,搞定了!谢谢个位好心大哥!!!!!

#4


嘿嘿,不要以为这里的人都是你的大哥呀,也有女子的

#5


路过!

#6


嘿嘿,不好意思!!!4楼的小妹!

#7


来的都是朋友!呵呵!

推荐阅读
author-avatar
海and云
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有