English 中文(简体)
NET ListBox - Disable selected items on mouse over
原标题:.NET ListBox - Disable selecting items on mouse over

我在单一选区有一个名单Box,其中包含一些项目。 我执行道,用户能够将项目重新排序为“rag”; 一切工作都很出色,但确实看着,因为如果 mo子倒, cur子正在转过一个项目,清单箱就自动选定一个项目。

To be specific: To disable flickering in some situations I only move items when the item is dragged more than half over another item. When I start dragging item1 over item2 to place it behind item2, I want item1 to be selected while dragging. What happens is that item2 gets selected as soon as the cursor moves over item2. How can I get rid of this behavior?

我已经在PreviewMouseMove试图将e.Handled = 变为实情,同时拖累一些物品,但是这赢得了一定帮助。

如欲见该守则,请登陆网站。 这是一种行为,它使任何具有IList作为数据来源的清单箱能够通过拖拉来调整其内容。

最佳回答

我最干净的解决办法是继承项目,执行我自己的“座标”。

问题回答

This is a ListView. And I did not go into the detail of you code. But I do PreviewMouseLeftButtonDown on the ListViewItem and I don t have the problem you describe.

 <ListView.ItemContainerStyle>
            <Style TargetType="{x:Type ListViewItem}">
                <EventSetter Event="PreviewMouseLeftButtonDown" Handler="ListView1Item_PreviewMouseLeftButtonDown" />
                <Setter Property="AllowDrop" Value="True" />
                <EventSetter Event="DragDrop.Drop" Handler="ListView1Item_DragDrop" />
                <Style.Triggers>                     
                    <DataTrigger Binding="{Binding DispDetail}" Value="False">
                        <Setter Property="Visibility" Value="Collapsed"/>
                    </DataTrigger>
                </Style.Triggers>
            </Style>
        </ListView.ItemContainerStyle>      




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签