相关疑难解决方法(0)

在Windows窗体中的文本标签中输入"&"符号?

如何Label在C#(Windows窗体)中输入特殊字符?

如果你试图在标签上写一个"&",你会得到一种下划线.

那么什么是C#相当于"&"?("\&"显然不起作用).

.net c# label special-characters winforms

98
推荐指数
3
解决办法
7万
查看次数

如何在Excel中的页眉/页脚中放置&符号?

我正在制作一个标题,需要一个&符号来分隔两个单词.

Hello & World

但是它忽略了&因为大多数内置函数将它评估为一个值,即.

Page &[Page] of &[Pages] => Page 1 of 3

&[Time]&T=>10:26

那么,如何逃避标题中的&符号?

excel vba excel-vba

7
推荐指数
1
解决办法
2145
查看次数

无法在C#中的按钮文本中显示“ &&”

我想显示&&Windows窗体应用程序中按钮的文本&,但是显示的按钮仅显示具有单个字符的文本。

// this is how the button is declared and formatted
Button si = new Button();
si.Width = 25;
si.Height = 25;
this.Controls.Add(si);
si.bringToFront();
si.Text = "&&";
si.Font = new Font("Arial", 4, FontStyle.Regular) // as you can see, I made the font so small, in order to make sure the text fits the size of the button
si.Top = 10;
si.Left = 10;
Run Code Online (Sandbox Code Playgroud)

当我创建一个MessageBox时,它告诉button.Text中包含什么文本,它将显示&&(所需结果)。但是,在Windows窗体上找到的按钮仅包含一个字符:&

我已经尝试过的一些方法如下所示:

// 1
si.Text = "&" + "&"; …
Run Code Online (Sandbox Code Playgroud)

c# button visual-studio winforms

2
推荐指数
2
解决办法
101
查看次数