发送密钥vb.net 2010

编程入门 行业动态 更新时间:2024-10-28 20:26:27
本文介绍了发送密钥vb 2010的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

For Each p As Process In Process.GetProcessesByName("notepad") AppActivate(p.Id) My.Computer.Keyboard.SendKeys("%of", True) Me.BringToFront() Next

我可以使用sendkeys打开notpad字体窗口。 但如何使用sendkeys更改记事本字体框的值???

I can open notpad font window using sendkeys. But How to change values of notepad font box using sendkeys???

推荐答案

您必须先发送键才能打开字体对话框。在我的瑞典计算机上,它是Alt + t打开格式菜单,然后Alt + t打开字体对话框。然后第三个Alt + t访问字体名称框,然后更改字体名称。 (您需要通过按住Alt键并注意菜单和控件中带下划线的字符来检查您自己的计算机是什么组合) 然后当然你必须在之后关闭对话框(输入,我认为)。 当然,如果这一点无论如何都无法保证用户或其他程序从记事本中移除焦点。 此外,您可能必须在每个组合键之间执行睡眠,以便让程序有时间做出反应。 唯一的方法就是试验,但是说到这一点,我真的不明白你想要实现的是什么... 创建一个适用于所有Windows语言的解决方案几乎是不可能的。 You have to send the keys to open the font dialog first. On my Swedish computer it''s "Alt + t" to open the format menu, then "Alt + t" to open the font dialog. Then a third "Alt + t" to access the font name box, and then the font name to change it. (You need to check on your own computer what the combination is by holding down the Alt key and noticing what character that is underlined in the menus and controls) Then of course you have to close the dialog afterwards (Enter, I think). Of course, there''s no guarantee that this is going to work all the time if the user or another program removes focus from Notepad. Also, you might have to execute a sleep between each key combination to give the program time to react. The only way is to experiment, but when that is said, I really don''t understand what it is you''re trying to achieve by this... It will be all but impossible to create a solution that will work on all Windows languages.

更多推荐

发送密钥vb.net 2010

本文发布于:2023-11-08 02:23:28,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1568070.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:密钥   vb   net

发布评论

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

>www.elefans.com

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