如何修改CListBox中任一Item的CString 如何修改CListBox中任一Item的CString,难道只能deletestring后再addstring?请教高手?? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 SetItemText(int nItem,int nSubItem,LPCTSTR lpszText); 就CListBox中任一Item的CString来说,是:用两个语句达到修改效果m_list.DeleteString(nSel);m_list.InsertString(nSel, "");当然你也可以重载CListBox来实现 谢谢,我的程序中如用deletestring后insertstring却出现闪烁现象,不知能否提供如自定义函数SetTest(int nIndex,CString newstr)之类的代码? 那是因为你频繁的deletestring后insertstring吧....用LockWindowUpdate与UnlockWindowUpdate呢? 还是闪呀!重载DrawItem又该如何做呢? 用LockWindowUpdate与UnlockWindowUpdate应该不会闪阿~难道你是每段delete和insert前后都加这个??? void CHyToolDlg::SetProgress(int total_read, int file_size,int nIndex){// LockWindowUpdate(); m_cListBox.DeleteString(nIndex); int percent=total_read*100/file_size; int blocknum=percent*20/100;//20个方块代表100% CString str="",temp; for (int i=0;i<blocknum;i++) str+="█"; temp.Format("%d",percent); str=str+temp+"%";// UnlockWindowUpdate(); m_cListBox.AddString(str);}SetProgress显示进度,如上加上LockWindowUpdate()和UnlockWindowUpdate()还是闪 void SetText(CListBox& list, int nSel, const CString& strItem){ list.LockWindowUpdate(); list.DeleteString(nSel); list.InsertString(nSel, ""); list.UnlockWindowUpdate();} VC截屏问题 有没有办法把一个OLE对象保存为一个图片文件 新手问题,关于MFC全局变量 高分请教!!有关滚动条的问题?急用!!!!! vc断点设置问题 关于全局钩子dll卸载的疑惑 我的程序每次编译执行时都会有个提示:one or more files are out of date or do not exit?我把系统时间往回调过,请问怎样在不改系统时 请问如何使按最小化时让程序触发一个动作? 有关bitmapbutton的问题 delphi里的try-finally VC里有吗,是不是要写成这样! 如何获取文件类型和大小而不下载? 同样一段C++代码,为什么编译通不过?
用两个语句达到修改效果
m_list.DeleteString(nSel);
m_list.InsertString(nSel, "");当然你也可以重载CListBox来实现
用LockWindowUpdate与UnlockWindowUpdate呢?
{
// LockWindowUpdate();
m_cListBox.DeleteString(nIndex);
int percent=total_read*100/file_size;
int blocknum=percent*20/100;//20个方块代表100%
CString str="",temp;
for (int i=0;i<blocknum;i++) str+="█";
temp.Format("%d",percent);
str=str+temp+"%";
// UnlockWindowUpdate();
m_cListBox.AddString(str);
}
SetProgress显示进度,如上加上LockWindowUpdate()和UnlockWindowUpdate()还是闪
{
list.LockWindowUpdate();
list.DeleteString(nSel);
list.InsertString(nSel, "");
list.UnlockWindowUpdate();
}