以编程方式向标签添加空格?

时间:2012-06-30 02:34:01

标签: c# winforms label

我有一个标签和代码:

            string User = Environment.UserName;
        toolStripStatusLabel1.Text = "This Software is Licensed to:" + User;

由于某种原因,输出是:

This Software is Licensed to:UserName

2 个答案:

答案 0 :(得分:3)

非常简单的修复:

string User = Environment.UserName;
toolStripStatusLabel1.Text = "This Software is Licensed to: " + User;
// Add a space after 'to:'

希望这有帮助!

答案 1 :(得分:1)

尝试在“:”

之后插入一个空格
相关问题