用:
pListView->GetListCtrl().SetItemState(ID, LVIS_SELECTED, LVIS_SELECTED);
下面是关于nMark的解释:
nMask
Mask specifying which state bits to change.
pListView->GetListCtrl().SetItemState(ID, LVIS_SELECTED, LVIS_SELECTED);
下面是关于nMark的解释:
nMask
Mask specifying which state bits to change.
解决方案 »
- 在对话框中取得BomboBox的当前显示位置
- 关机代码失败:使用ZwShutdownSystem(native API)在WIN2000下可以关机,在WINDOWS ME下关机失败
- 这是偶试验成功的,各位大虾评价一下,在MFC中使用多文档,在程序启动时不出现对话框
- 来看一段代码,找找问题原因
- 如何响应按键消息绘制动画?
- 如何将list ctrl中的内容导入excel 或 word 或 文本形式,高分求教,不够在加
- 奇怪啊,IXMLDOMDocument2的get_documentElement失败
- 关于用Execute执行SQL语句的问题(在线等待立即给分)
- WINSOCK2转换IP为域名时的问题
- 请教,用什么软件可以解开用ASPack压过的EXE?就是还原成原来的EXE
- 如何在activex控件中添加一个类似于AboutBox()的全程函数
- VC中CSocket如何通过代理(socks或http)post数据?
pListView->GetListCtrl().SetItemState(ID, 1, LVIS_SELECTED);
更详细的解释在这:
stateMask
Value specifying which bits of the state member will be retrieved or modified. For example, setting this member to LVIS_SELECTED will cause only the item's selection state to be retrieved.
This member allows you to modify one or more item states without having to retrieve all of the item states first. For example, setting this member to LVIS_SELECTED and state to zero will cause the item's selection state to be cleared, but none of the other states will be affected. To retrieve or modify all of the states, set this member to (UINT)-1.
View->GetListCtrl().SetItemState(ID, (UINT)-1, LVIS_SELECTED);