gpt4 book ai didi

c# - 并登录 LinkLabel 文本

转载 作者:太空宇宙 更新时间:2023-11-03 17:54:20 26 4
gpt4 key购买 nike

这个问题在这里已经有了答案:





Enter "&" symbol into a text Label in Windows Forms?

(5 个回答)


8年前关闭。




我想显示文字 a&b在我的LinkLabel.Text .

linkLabel1.Text = "a&b";

这显示:

ab



如果我将代码更改为:
 linkLabel1.Text = "a&&b";

一个 &标志将显示。

a&b



这是打印一个&符号的正确方法吗?

最佳答案

&在 winform 中用于 Alt 的快捷键。通过使用双 &&您正在转义快捷键修饰符。

所以对于 "a&b" ,快捷键/热键为:alt+b
您可能会看到:How to: Create Access Keys for Windows Forms Controls

Set the Text property to a string that includes an ampersand (&) before the letter that will be the shortcut.

关于c# - 并登录 LinkLabel 文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15633352/

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