|
-
January 18th, 2010, 10:03 AM
#1
[RESOLVED] Align label text in WebForms
I have programmatically created a label and would now like to align the text to the center. I am using C# with ASP.NET so cannot use the usual Windows.Form methods.
foreach (string grade in eNumGradesList)
{
lblENumGrade = new Label();
cellENumGrade = new TableCell();
// Position cells and specify details
lblENumGrade.Text = grade;
this.lblENumGrade.Text = this.lblENumGrade.Text.PadLeft(this.lblENumGrade.Text.Length + 25); // NOT WORKING
//lblENumGrade.Text.PadLeft(20); //NOT WORKING EITHER
cellENumGrade.Controls.Add(lblENumGrade);
cellENumGrade.BorderColor = System.Drawing.Color.Blue;
rowHeader.Controls.Add(cellENumGrade);
}
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|