mfc如何让listbox横向滚动条起作用
voidCListbox4Dlg::OnSelchangeList1(){//TODO:Addyourcontrolnotificationhandlercodehere...
void CListbox4Dlg::OnSelchangeList1()
{
// TODO: Add your control notification handler code here
int dx = 0;
CSize sz;
CDC* pDC = list.GetDC();
CString str;
for (int j = 0; j < list.GetCount();j++)
{
list.GetText(j, str);
sz = pDC -> GetTextExtent(str);
if(sz.cx > dx)
dx = sz.cx;
}
list.ReleaseDC(pDC);
list.SetHorizontalExtent(dx);
}
错误提示:list box 4Dlg.obj : error LNK2001: unresolved external symbol "public: int __thiscall CListBox::SetHorizontalExtent(int)" (?SetHorizontalExtent@CListBox@@QAEHH@Z)
Debug/list box 4.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe. 展开
{
// TODO: Add your control notification handler code here
int dx = 0;
CSize sz;
CDC* pDC = list.GetDC();
CString str;
for (int j = 0; j < list.GetCount();j++)
{
list.GetText(j, str);
sz = pDC -> GetTextExtent(str);
if(sz.cx > dx)
dx = sz.cx;
}
list.ReleaseDC(pDC);
list.SetHorizontalExtent(dx);
}
错误提示:list box 4Dlg.obj : error LNK2001: unresolved external symbol "public: int __thiscall CListBox::SetHorizontalExtent(int)" (?SetHorizontalExtent@CListBox@@QAEHH@Z)
Debug/list box 4.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe. 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询