本文介绍了将鼠标单击发送到 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 中的按钮
发布评论