如何捕获所有双击 [英] How to capture all double clicks

查看:83
本文介绍了如何捕获所有双击的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好。我是VB的新手。使用VB 2005.


我已经用程序编程工作了25年,但从不对象或事件驱动。


我有一个表格选项卡控件和10个选项卡。每个标签都有一棵树。树的每个分支都是菜单选择。通用子程序的参数包含在节点标签中。


我想用一段代码从任意树中捕获任意双击。

类似于:

Hi. I am very new to VB. Using VB 2005.

I have worked for 25 years with procedural progamming, but never object or event driven.

I have a form with a tab control and 10 tabs. Each tab has a tree. Each branch of the tree is a menu selection. The parameter for a generic subroutine is contained in the node tag.

I would like to capture ANY double click from ANY tree with a single piece of code.
Something like:

展开 | 选择 | Wrap | 行号

推荐答案


嗨。我是VB的新手。使用VB 2005.


我已经用程序编程工作了25年,但从不对象或事件驱动。


我有一个表格选项卡控件和10个选项卡。每个标签都有一棵树。树的每个分支都是菜单选择。通用子程序的参数包含在节点标签中。


我想用一段代码从任意树中捕获任意双击。

类似于:

Hi. I am very new to VB. Using VB 2005.

I have worked for 25 years with procedural progamming, but never object or event driven.

I have a form with a tab control and 10 tabs. Each tab has a tree. Each branch of the tree is a menu selection. The parameter for a generic subroutine is contained in the node tag.

I would like to capture ANY double click from ANY tree with a single piece of code.
Something like:

展开 | 选择 | Wrap | 行号


感谢您的快速回复,但这不是我遇到问题的部分我将尝试澄清我的意思。


我有10个树视图,每个节点有20个节点(或更多) 。

每棵树都被命名为treeXXXX。每个XXXX都不同。


我不想为每个节点编写相同的事件。

我只想写一个事件响应双击表单上的任何树并返回节点标记&点击的名称。


再次感谢。
Thanks for the quick reply, but thats not the part I have a problem with.

I''ll try to clarify what I meant.

I have 10 treeViews with 20 nodes (or more) on each.
Each tree is named "treeXXXX" where XXXX is different for each.

I don''t want to write the same event for each node.
I would like to write just one event that responds to a double click on any tree on the form and returns the node tag & name that was clicked.

Thanks again.


如果您使用的是VB6,那么您可以将它们创建为一个控制数组,它将按照你建议的方式工作 - 所有这些都是一个例程。


不要认为它可以简化到那么大程度但是在VB2005中。 MS确实喜欢在功能方面做出很大的飞跃向后推进


实际上,我认为你只需为每个代码编写例程。但请记住,它们可能只是一些小存根,它们在某处都称为相同的代码。
What''s really sad is that if you were using VB6 you could just create them as a control array, and it would work exactly the way you suggested - one routine for all of them.

Don''t think it''s possible to simplify it to quite that degree in VB2005, though. MS do love to make great leaps backward in functionality, sometimes.

As it is, I think you''ll just have to code a routine for each. Keep in mind though, they could be just little stubs which all call the same piece of code somewhere.


这篇关于如何捕获所有双击的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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