vc 中关于这个SetExtendedStyle的错误
程序代码:m_ListCtrl.SetExtendedStyle(LVS_EX_HEADERDRAGDROP|LVS_EX_FULLROWSELECT|LVS_EX_TR...
程序代码:
m_ListCtrl.SetExtendedStyle(LVS_EX_HEADERDRAGDROP|LVS_EX_FULLROWSELECT|LVS_EX_TRACKSELECT);
int i=0,iCount;
m_ListCtrl.DeleteAllItems();
CString sz[4]={"Name","Sex","Birthday","Fav"};
for(short ii=0;ii<4;ii++)
{
m_ListCtrl.InsertColumn(ii,sz[ii],LVCFMT_CENTER,80);
}
CStdioFile file;
CString GFilePath="studentInfo.txt";
file.Open(GFilePath,CFile::modeReadWrite);
CString str=" ";
int nCol=0;
int iRow=0;
while(file.ReadString(str))
{
if(nCol==0)
{
m_ListCtrl.InsertItem(iRow,str);
}
else
{
m_ListCtrl.SetItemText(iRow,nCol,str);
}
nCol=(++nCol)%5;
if(nCol==0)
iRow++;
}
file.Close();
运行后的错误:
error C2039: 'SetExtendedStyle' : is not a member of 'CListBox'
d:\program files\microsoft visual studio\vc98\mfc\include\afxwin.h(2741) : see declaration of 'CListBox'
F:\c++\CtrlDlg\CtrlDlgDlg.cpp(121) : error C2039: 'DeleteAllItems' : is not a member of 'CListBox'
d:\program files\microsoft visual studio\vc98\mfc\include\afxwin.h(2741) : see declaration of 'CListBox'
F:\c++\CtrlDlg\CtrlDlgDlg.cpp(125) : error C2039: 'InsertColumn' : is not a member of 'CListBox'
d:\program files\microsoft visual studio\vc98\mfc\include\afxwin.h(2741) : see declaration of 'CListBox'
F:\c++\CtrlDlg\CtrlDlgDlg.cpp(137) : error C2039: 'InsertItem' : is not a member of 'CListBox'
d:\program files\microsoft visual studio\vc98\mfc\include\afxwin.h(2741) : see declaration of 'CListBox'
F:\c++\CtrlDlg\CtrlDlgDlg.cpp(141) : error C2039: 'SetItemText' : is not a member of 'CListBox'
d:\program files\microsoft visual studio\vc98\mfc\include\afxwin.h(2741) : see declaration of 'CListBox' 展开
m_ListCtrl.SetExtendedStyle(LVS_EX_HEADERDRAGDROP|LVS_EX_FULLROWSELECT|LVS_EX_TRACKSELECT);
int i=0,iCount;
m_ListCtrl.DeleteAllItems();
CString sz[4]={"Name","Sex","Birthday","Fav"};
for(short ii=0;ii<4;ii++)
{
m_ListCtrl.InsertColumn(ii,sz[ii],LVCFMT_CENTER,80);
}
CStdioFile file;
CString GFilePath="studentInfo.txt";
file.Open(GFilePath,CFile::modeReadWrite);
CString str=" ";
int nCol=0;
int iRow=0;
while(file.ReadString(str))
{
if(nCol==0)
{
m_ListCtrl.InsertItem(iRow,str);
}
else
{
m_ListCtrl.SetItemText(iRow,nCol,str);
}
nCol=(++nCol)%5;
if(nCol==0)
iRow++;
}
file.Close();
运行后的错误:
error C2039: 'SetExtendedStyle' : is not a member of 'CListBox'
d:\program files\microsoft visual studio\vc98\mfc\include\afxwin.h(2741) : see declaration of 'CListBox'
F:\c++\CtrlDlg\CtrlDlgDlg.cpp(121) : error C2039: 'DeleteAllItems' : is not a member of 'CListBox'
d:\program files\microsoft visual studio\vc98\mfc\include\afxwin.h(2741) : see declaration of 'CListBox'
F:\c++\CtrlDlg\CtrlDlgDlg.cpp(125) : error C2039: 'InsertColumn' : is not a member of 'CListBox'
d:\program files\microsoft visual studio\vc98\mfc\include\afxwin.h(2741) : see declaration of 'CListBox'
F:\c++\CtrlDlg\CtrlDlgDlg.cpp(137) : error C2039: 'InsertItem' : is not a member of 'CListBox'
d:\program files\microsoft visual studio\vc98\mfc\include\afxwin.h(2741) : see declaration of 'CListBox'
F:\c++\CtrlDlg\CtrlDlgDlg.cpp(141) : error C2039: 'SetItemText' : is not a member of 'CListBox'
d:\program files\microsoft visual studio\vc98\mfc\include\afxwin.h(2741) : see declaration of 'CListBox' 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询