作者:海and云 | 来源:互联网 | 2023-08-16 12:30
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 个解决方案
看看InsertColumn的返回值是什么,用GetLastError找下错误
你选择的样式是不是默认的”Icon"呀,应该选择“Report"样式吧
在它的属性窗口中,将STYLE 属性页中的 View下拉框中选择 “Report"样式试试
谢谢大哥门!就是2楼的大哥说的,搞定了!谢谢个位好心大哥!!!!!