gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-01 08:43:00 25 4
gpt4 key购买 nike

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

最佳答案

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

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

if (button is Button)
{
ButtonAutomationPeer peer = new ButtonAutomationPeer((Button)button);

IInvokeProvider ip = (IInvokeProvider)peer;
ip.Invoke();
}

关于silverlight - 将鼠标单击发送到silverlight 2中的按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/186553/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com