Hunter Mitchell
Hunter Mitchell

Reputation: 7293

Add a space to a label Programmatically?

I have a label and this code:

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

For some reason the output is:

This Software is Licensed to:UserName

Upvotes: 0

Views: 473

Answers (2)

gui_s3
gui_s3

Reputation: 138

Try to insert a space after the ":"

Upvotes: 1

matthewr
matthewr

Reputation: 4749

Very simple fix:

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

Hope this helps!

Upvotes: 3

Related Questions