我用的是
m_lstLink.InsertItem(0, "");
m_lstLink.SetItemText(0, 0, "test1");
m_lstLink.InsertItem(0, "");
m_lstLink.SetItemText(0, 0, "test2");可是插入后test2显示在test1的上面?请问有什么方法可以使插入后test2排在test1的下面?还有插入完成后怎么查找test2的index?
m_lstLink.InsertItem(0, "");
m_lstLink.SetItemText(0, 0, "test1");
m_lstLink.InsertItem(0, "");
m_lstLink.SetItemText(0, 0, "test2");可是插入后test2显示在test1的上面?请问有什么方法可以使插入后test2排在test1的下面?还有插入完成后怎么查找test2的index?
解决方案 »
- 菜鸟向大家请教2个简单问题, 关于AFX_EXT_CLASS 的问题
- 用Direct3D画三维图形如何转换坐标?
- 如何捕捉"internet explorer 脚本错误"窗口的建立并阻止它
- 请问有谁用的是酷瑞CPU的?
- TChar szAppName[] = "Hello";
- 如何获取当前桌面某个坐标的颜色的颜色?hdc如何获取呢?不是某个窗口。
- VC中如何把整数和float类型的变量转化成字符串型?
- 关于UNICODE的一个小问题?请大家帮个忙(急!!!!!!)
- 问各位大拿们一个硬盘盘符错乱的问题
- 我找了一个滚动文本图像的控件,但是为什么显示不了汉字??
- 求助
- COM线程模型里关于调用CoInitialize()的问题
m_lstLink.SetItemText(0, 0, "test1");
m_lstLink.InsertItem(1, "");
m_lstLink.SetItemText(1, 0, "test2");
m_lstLink.SetItemText(ind , 0, "test1");
ind = m_lstLink.InsertItem( m_lstLink.GetItemCount() , "");
m_lstLink.SetItemText(ind , 0, "test2");
int FindItem( LVFINDINFO* pFindInfo, int nStart = -1 ) const;Return ValueThe index of the item if successful or -1 otherwise.ParameterspFindInfoA pointer to aLVFINDINFO structure containing information about the item to be searched for. nStartIndex of the item to begin the search with, or -1 to start from the beginning. The item at nStart is excluded from the search if nStart is not equal to -1.ResUse this function to search for a list view item having specified characteristics.The pFindInfo parameter points to an LVFINDINFO structure, which contains information used to search for a list view item.Example// The pointer to my list view control.
extern CListCtrl* pmyListCtrl;
// The string to match.
extern LPCTSTR lpszmyString;LVFINDINFO info;
int nIndex;info.flags = LVFI_PARTIAL|LVFI_STRING;
info.psz = lpszmyString;// Delete all of the items that begin with the string lpszmyString.
while ((nIndex=pmyListCtrl->FindItem(&info)) != -1)
{
pmyListCtrl->DeleteItem(nIndex);
}
我的是
lvcol.mask= LVCF_FMT|LVCF_SUBITEM|LVCF_TEXT|LVCF_WIDTH;
lvcol.fmt= LVCFMT_LEFT;
这个是不是有问题?
m_lstLink.SetItemText(ind , 0, "test1");
ind = m_lstLink.InsertItem( m_lstLink.GetItemCount() , "");
m_lstLink.SetItemText(ind , 0, "test2");
我试了这个,可是不行啊