ListControl 控件怎么多选?

project2502 2012-05-10 04:11:21
是有多选的风格
还是有其他什么方法....
...全文
539 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
project2502 2012-05-10
  • 打赏
  • 举报
回复
问题已经解决

SetItemState(i, LVIS_DROPHILITED,LVIF_STATE);

这样就好了.
project2502 2012-05-10
  • 打赏
  • 举报
回复
能不能不按住ctrl 多选?

尝试在lvn_itemchanged的事件响应里用 SetItemState 选别的项
想达到选一个项就能选多项的效果

现在的状况是 按住ctrl 用 SetItemState 可以多选

不按ctrl 鼠标按下去时 多个项被选中了 松开时只剩下一项还亮着

该怎么让它们都亮着?
project2502 2012-05-10
  • 打赏
  • 举报
回复
用SetItemState怎么选了别的 当前行就失去选中状态
liuli7786 2012-05-10
  • 打赏
  • 举报
回复
正常按下Ctrl键,鼠标单击ListControl行,可以选中多行;
如果ListControl的Single Selection属性设置为TRUE,则只能选中一行
dahaiI0 2012-05-10
  • 打赏
  • 举报
回复
HitTest得到索引,SetItemState
project2502 2012-05-10
  • 打赏
  • 举报
回复
....你发的好像是listbox 不是listcontrol
zjs100901 2012-05-10
  • 打赏
  • 举报
回复
Selection
Determines how items in a list box can be selected. Possible values are as follows:


Single (default): Users can select only one item in a list box at a time.

Multiple: Users can select more than one list-box item at a time, but cannot extend the selection from where it starts. The SHIFT and CTRL keys can be used together with the mouse to select and deselect items, including non-adjacent items. Clicking or double-clicking an unselected item selects it. Clicking or double-clicking a selected item deselects it.

Extended: Users can extend the selection by dragging. The SHIFT and CTRL keys can be used together with the mouse to select and deselect list-box items, select groups of items, and select non-adjacent items.

None: Users cannot select any items.

有多选的风格

15,981

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 界面
社区管理员
  • 界面
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧