MouseLeftButtonDown event not working for Textbox in Silverlight

来源:互联网 发布:ipad pro笔记软件 编辑:程序博客网 时间:2024/05/24 00:07

Silverlight的TextBox的MouseLeftButtonDown事件不起作用。

解决办法:

用TextBox的AddHandler方法添加事件处理程序。例如

txtPassword.AddHandler(TextBox.MouseLeftButtonDownEvent, new MouseButtonEventHandler(MouseLeft), true);

=-=-=-

Adds a routed event handler for a specified routed event, adding the handler to the handler collection on the current element. Specify handledEventsToo as true to have the provided handler be invoked for routed event that had already been marked as handled by another element along the event route. (摘自msdn, http://msdn.microsoft.com/en-us/library/ms598899(v=vs.95).aspx )

0 0
原创粉丝点击