ListBox/ListView选择 [英] ListBox/ListView Selection

查看:74
本文介绍了ListBox/ListView选择的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在使用扩展选择模式对ListBox/ListView项目实施拖放.扩展选择模式允许通过在选择其他项目的同时按住Shift或控制键来同时选择多个项目.

We are implementing drag/drop on ListBox/ListView items with the extended selection mode. The extended selection mode allows multiple items to be selection simultaneously by holding the shift or control key while selecting additional items.

在Windows资源管理器中,当单击一组选定项中的单个项时,直到上单击事件才取消所有其他项.这样一来,个人就可以选择所需的组,然后将整个组整体单击并拖动到所需的目的地.

In Windows Explorer, when an individual item among a group of selected items is clicked, all of the other items are not deselected until the up-click event. This allows an individual to select the desired group and then click and drag this group as a whole to the desired destination.

在WPF中,似乎已取消选择该组,并在向下单击事件中选择了单个项目.这意味着,要拖动一组项目,必须按住shift键,在所需范围的项目上单击并按住鼠标,然后拖动该组.如果先选择了该组然后放开鼠标,则在对该组进行拖动尝试时,将选中单独单击的项目.

In WPF, the group appears to be deselected and the individual item selected on the down-click event. This means that in order to drag a group of items, you must hold shift, click and hold the mouse on the desired range of items and then drag the group. If the group is selected first and then the mouse released, the individually clicked item is selected when a drag attempt is made on the group.

我们正在使用WPF,但希望看到Windows资源管理器的选择功能.关于如何调和这两个实现有什么想法?最直接的解决方法是自定义控件,该控件可能源自ListBox/ListView,但这似乎正在重新发明轮子.似乎WPF控件在这里设计不正确.

We are using WPF, but would like to see the Windows Explorer selection functionality. Any thoughts on how to reconcile these two implementations? The most straight forward fix would be a custom control, possibly derived from ListBox/ListView, but this seems like it might be reinventing the wheel. Seems like the WPF controls are not designed properly here.

谢谢.

推荐答案

晚了聚会,但还是...我发现了这一点:

Late to the party, but still... I found this:

您是否设法找到了针对多选拖放问题的解决方案?我目前也在为此苦苦挣扎.

Did you manage to find a solution for this multiple-selection drag-and-drop issue? I'm currently struggling with it as well.

科恩


这篇关于ListBox/ListView选择的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆