将文本发送到在另一个应用程序中重点的编辑文本

发布于 2025-02-08 10:50:29 字数 318 浏览 2 评论 0原文

我的表单是最上方= true,有一个按钮。我希望,当我单击另一个应用程序中的文本字段并单击“示例”文本到具有光标焦点的控件时。

但是,我只能通过不将焦点从组件中焦点进行焦点的事件来做到这一点

private void button1_MouseHover(object sender, EventArgs e)
{
    SendKeys.Send("test");
}

,我有任何方法可以单击按钮将文本设置在具有焦点的控件上吗?类似于Windows win + v

I have a form that is TopMost = true, which has a button. I want that when I click on the text field in another application and click on the button it sends an 'example' text to the control that has cursor focus.

but I was only able to do this with the onHover event that doesn't take the focus off the component

private void button1_MouseHover(object sender, EventArgs e)
{
    SendKeys.Send("test");
}

is there any way for me to click the button to set the text on the control that has focus? similar to windows Win+V

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文