LinkLabel.Click 和 LinkLabel.LinkClicked 事件之间的区别?
根据 http://msdn.microsoft.com/en -us/library/system.windows.forms.linklabel.aspx,LinkLabel
类具有继承自的 Click
事件System.Windows.Forms.Control
和 LinkClicked
事件。据我了解,Click
事件将触发LinkClicked
事件。
到底为什么要有 LinkClicked
事件? Click
事件出了什么问题?除了点击之外还有其他方式触发LinkClicked
吗?
According to http://msdn.microsoft.com/en-us/library/system.windows.forms.linklabel.aspx, the LinkLabel
class has both a Click
event inherited from System.Windows.Forms.Control
and a LinkClicked
event. From my understanding, Click
event will trigger the LinkClicked
event.
Why on earth have a LinkClicked
event?? What's wrong with the Click
event? Are there other ways to trigger LinkClicked
besides clicking?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您单击控件中的任意位置,则会引发
Click
。仅当您单击链接区域时才会引发LinkClicked
。在这两种情况下都会引发Click
(如果您单击链接,则在LinkClicked
之前)。Click
will be raised if you click anywhere in the control.LinkClicked
will be raised only if you click on a link area.Click
will be raised in both cases (beforeLinkClicked
if you click on a link).LinkClicked 事件具有特定的 LinkLabelLinkClickedEventArg,允许您不仅仅是响应 Click 事件,用户单击控件上的任何位置而不仅仅是链接部分都可以触发该事件。
The LinkClicked event has specific LinkLabelLinkClickedEventArg that allows you to do more than responding to the Click event, which could be fired by the user clicking anywhere on the control not just the link part.