因为ClistCtrl不能编辑,所有派生了一个类,做了一些复杂的操作。实现了功能,但是现在的问题是只要有其他窗体覆盖显示,不管是模态的还是非模态的,显示后item里面所有的数据都看不见了鼠标点一下某一行(已经设置LVS_EX_FULLROWSELECT 整行选择),这行的数据才出来,但是用GetItemText取数时取不到了。一般会是什么问题?还请各位懂得指点一下。设置invalidate()也没有用。
解决方案 »
- 如何向导对话框字体
- DMA_READ的问题, 是不是读写文件系统有什么局限性啊
- 如何使用Windows Media Player的controls功能,实现歌曲的暂停?
- 有谁知道bt,emule使用的是什么安装软件么?
- 这个调试错误怎样解决,请帮忙!
- 各位大哥,小女子遇到了问题,请帮个忙好吗?
- DepthEstVC6d.exe 中的 0x004464f6 处有未经处理的异常: 0xC0000005: 读取位置 0xcccccccc 时发生访问冲突
- 如何用最简单实用的方法解决一个窗口的自定义鼠标问题?我自己使用了一个方法,可效果不大好,来看看
- 关于对话框的打印
- Error LNK2001
- 请帮我解决一下这个问题
- 【每月都散分】 留下300分备用提问,其余全贡献出来 4
CListCtrl要做成可编辑的,也是挺容易的事情。不需要派生子类来完成。
This style can be set when creating the control or even later by using ModifyStyle().
Once we have set the LVS_EDITLABELS style, the user can set focus on an item and click on it again to begin editing the item.
However, the default behaviour of the control ignores the changes once the edit is complete.
To allow the edit changes to be accepted, we have to add a handler to the LVN_ENDLABELEDIT notification.
Here is a sample of a reflected message handler (e.i. the message is handled by the list view control itself,
rather than the parent window).void CMyListCtrl::OnEndLabelEdit(NMHDR* pNMHDR, LRESULT* pResult)
{
*pResult = TRUE;
}If we set *pLResult to FALSE, the changes are ignored. Allowing edits of sub items are not directly supported
by the control but can be easily implemented. It is covered in a different section. ============Normally an edit is initiated when a user clicks on an item that already has the focus.
Suppose, you want to start the edit when the user clicks a button, here is the code to start the edit.m_listctrl.SetFocus();
m_listctrl.EditLabel(nItem);You should remember to SetFocus() if the listview control does not already have the focus.
Of course, for this to work, the listview control should have the LVM_EDITLABEL style.
看一下这个例子