处理Treeview MouseDown,ModeMouseClick&节点双击事件同时发生. [英] Handle Treeview MouseDown, ModeMouseClick & Node Double click events at same time.

查看:116
本文介绍了处理Treeview MouseDown,ModeMouseClick&节点双击事件同时发生.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



实现mousedown后如何处理treeview的nodemouceclick事件和双击事件.

Hi,

How to handle the nodemouceclick event and double click event of treeview when the mousedown has implemented.

Thank''s in Advance.

推荐答案

您可能找不到这些评论作为对您问题的答案",但是...我认为这是我唯一的方法鉴于您提供的信息有限,这可能对您有所帮助.

1.我建议您创建一个新的WinForms项目,在其上放置一个TreeView,并为TreeView的定义处理程序:

BeforeSelect,AfterSelect,NodeMouseClick,NodeDoubleMouseClick,Click,DoubleClick,MouseDown,MouseClick,MouseDoubleClick事件.

在这些处理程序中,放置一个简单的Console.WriteLine语句,以打印出事件的名称.像这样:
You may not find these comments an "answer" to your question, but ... I think this is the only way I can be helpful to you, given the limited information you provide.

1. I suggest you create a new WinForms project, put a TreeView on it, and define handlers for the TreeView''s:

BeforeSelect, AfterSelect, NodeMouseClick, NodeDoubleMouseClick, Click, DoubleClick, MouseDown, MouseClick, MouseDoubleClick Events.

In those handlers put a simple Console.WriteLine statement printing out the name of the Event. Like this:
private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
{
    Console.WriteLine("treeView1_NodeMouseClick");
}


然后,使用您自己的以下操作运行该项目四次:

一个.缓慢地在TreeView节点上单击鼠标,然后释放鼠标.

b.以稍快的速度,在TreeView节点上单击几下.

C.双击TreeView节点,以最快的速度释放鼠标.

d.尽可能快地双击TreeView节点.

在项目的每个运行"之后,检查输出"窗口,并考虑您观察到的内容.

2.在实现了DragDrop的代码中,为与DragDrop相关的所有事件(例如ItemDrag)定义类似的事件处理程序.运行,开始拖动,然后停止拖动,然后再移出TreeView的边界,停止程序,检查输出.对DragDrop操作的每个可能部分重复上述操作.

我为什么建议您这样做:因为我相信您会观察到会导致您按原样更改交互设计的行为.我相信一旦您了解了控件和鼠标之间的运行时交互的基础,然后了解了DragDrop事件,您将能够在实现策略中做出明智的选择.

Bill,祝你好运


And then, run the project four times with these actions on your part:

a. slowly mouse click on a TreeView Node and release the Mouse.

b. at a slightly faster rate, do several mouse clicks on the TreeView Node.

c. double-click on the TreeView Node, releasing the Mouse as fast as possible.

d. do a series of double-clicks on a TreeView Node as fast as possible.

After each "run" of the Project, examine the Output window, and consider what you observe.

2. In code where you have DragDrop implemented define similar Event handlers for ALL Events related to DragDrop, like ItemDrag. Run, start a drag but stop the drag before you move outside the boundaries of the TreeView, stop the program, examine the output. Repeat for each possible part of a DragDrop operation.

Why do I suggest you do this: because I believe you will observe behavior that will lead you to change your interaction-design as it is. Once you understand the fundamentals of run-time interaction between Controls and Mouse, and then the DragDrop Events, you will, I believe, be able to make wise choices in your implementation strategy.

good luck, Bill


嗨BillWoodruff,

我有一个树状视图.我想在选定的节点中添加节点.我的数据来自SharePoint自定义列表.自定义列表包含两个内容类型文件夹.我该如何实现.能否为我提供解决方案.
Hi BillWoodruff,

I have a treeview.I want to add node in selected node.My data is coming from SharePoint custom list.Custom list contains two content type folder.How can I achieve this.Can you provide me the solution.


这篇关于处理Treeview MouseDown,ModeMouseClick&节点双击事件同时发生.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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