Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想知道是否可以使用 sendkeys.sendwait() 方法显示格式化(如粗体、字体大小)文本。
注意:缩进的文本字符串已经格式化。我需要在应用程序上打印它们。
我可以用剪贴板做些什么吗?
正如 Robert Harvey 所说,您必须发送触发格式化的键。如果您正在使用允许粗体、斜体、下划线的文字处理器,您可以像这样实现以下目标:
SendKeys.SendWait("^BThis is bold Text!^B^IThis is italics!^I^UThis is underlined!");
...假设 CTRL+B 是粗体,CTRL+I 是斜体,CTRL+U 是下划线。