将鼠标单击发送到 Silverlight 2 中的按钮

编程入门 行业动态 更新时间:2024-10-26 14:33:21
本文介绍了将鼠标单击发送到 Silverlight 2 中的按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

silverlight 应用中有按钮控件.我可以以编程方式向它发送鼠标点击事件吗?

There is the button control in silverlight application . Can I send a mouse click event to it programmatically?

推荐答案

如果您仍想这样做.您现在可以升级到 Silverlight 3.0 或更高版本并执行以下操作:

If you still want to do that. You can now upgrade to Silverlight version 3.0 or later versions and do the following:

您可以使用 System.Windows.Automation.Peers 中的按钮自动化对等点来完成您想要的操作.

You can use the button automation peer from System.Windows.Automation.Peers to accomplish what you want.

if (button is Button) { ButtonAutomationPeer peer = new ButtonAutomationPeer((Button)button); IInvokeProvider ip = (IInvokeProvider)peer; ip.Invoke(); }

更多推荐

将鼠标单击发送到 Silverlight 2 中的按钮

本文发布于:2023-06-06 10:49:10,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/539012.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:鼠标   发送到   单击   按钮   Silverlight

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!