user2211486
user2211486

Reputation: 237

Display different labels on different lines

I basically want the different labels to come on different lines.

protected void Button2_Click(object sender, EventArgs e)
{
    Label2.Text = Label3.Text + Label1.Text;
}

I want the Label1.Text to display on the line below Label3.Text. I do not want to tweak the width and height cause the Text in the labels won't be of the same width in every label.

Upvotes: 2

Views: 341

Answers (2)

Avishek
Avishek

Reputation: 1896

A more elegant approach:

Label2.Text = Label3.Text + Environment.NewLine() + Label1.Text;

Upvotes: 0

शेखर
शेखर

Reputation: 17614

try using <br/> in between it should work

Label2.Text = Label3.Text +"<br/>"+ Label1.Text;

Upvotes: 4

Related Questions