双击控件时,停止设计器创建事件 [英] Stop the designer from creating an event when a control is double clicked

查看:84
本文介绍了双击控件时,停止设计器创建事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当双击设计器中的控件时,是否有任何选项可以禁用自动生成单击事件?

Is there any option to disable the automatic generation of a click event when a control in the designer is double clicked?

如果没有选项可以禁用此功能什么是干净地删除设计器生成的代码的最佳方法?

If there is no option to do disable this then what is the best way to remove the designer generated code cleanly?

在尝试移动设计器时,我经常意外地双击设计器中的控件精确到位。设计师似乎计算从鼠标到下一个鼠标的时间,鼠标按下双击而不是完全鼠标按下/向上下一个
鼠标按下/向上。当我只是试图通过拖放移动控件时,这会导致意外双击。我放弃了一个我不想要它的控件,然后点击并按住以将其重新选中,但它被视为双击并自动
为控件生成一个点击事件。非常讨厌。

I very frequently accidently double click a control in designer when attempting to move it into place with precision. The designer appears to count the time from mouse up to next the mouse down as double click rather than full mouse down/up to next mouse down/up. This causes accidental double clicks all the time when I'm just trying to move controls around with drag and drop. I drop a control where I don't want it, then click and hold to pick it back up but it gets seen as a double click and automatically generates a click event for the control. Very annoying.

尝试删除代码会导致各种问题。使用撤消将撤消对设计器所做的大量更改,从而导致大量丢失的工作。简单地删除事件的代码是行不通的,因为在其他地方生成的代码仍然存在

Attempting to remove the code causes all sorts of problems. Using Undo will undo a whole lot of changes made to the designer causing a lot of lost work. Simply deleting the code for the event doesn't work because it there is code generated in other places that still exists.

我想完全禁用它,但如果它可以没有被禁用我想知道如何撤消设计师对代码的更改而不会弄乱任何其他内容。我已经尝试搜索这个问题的答案,但搜索条件只返回了太多
与事件相关的其他结果。

I want to just disable this entirely but if it can't be disabled I'd like to know how to undo the designers changes to the code without messing anything else up. I've tried searching for an answer to this question but the search terms just return too many other results relating to events.

推荐答案

始终说明您正在使用的Visual Studio版本和版本。



某些功能在不同版本中保持一致,而其他功能可能会发生变化。

之后所有,改变是发布新的b $ b版本的动力因素之一。 ;-)



- Wayne
Always state which version and edition of Visual Studio you're using.

Some features are consistent across versions while others may change.
After all, change is one of the motivating factors for releasing new
versions. ;-)

- Wayne


这篇关于双击控件时,停止设计器创建事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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