简体   繁体   English

C#背后的代码中的按钮上的双空格文本

[英]Double Space text on button from code behind C#

I need to add text on a asp.net button depending on a virtual keyboard status 我需要根据虚拟键盘状态在asp.net按钮上添加文本

if the keyboard is visible the button text must be Hide Keyboard and if the Keyboard is not visible the text must be Show Keyboard. 如果键盘可见,则按钮文本必须为“隐藏键盘”;如果键盘不可见,则文本必须为“显示键盘”。 the button width is too short for the text i need to do a double space text inside the button i had already tried with 按钮宽度对于文本来说太短了,我需要在已经尝试过的按钮内做一个双空格文本

1-

2- </br>
3- /n
4-adding a literal br

and nothing works can somebody help me with this? 而且没有任何工作可以帮助我吗?

Thanks in advance 提前致谢

If you want multiline text in asp.net assign text in code begind. 如果要在asp.net中使用多行文本,请在代码开头分配文本。 it's not pretty but it works well. 它不是很漂亮,但是效果很好。

button.Text = "Line1" + Environment.NewLine + "Line2";

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM