Ahmad Houri
Ahmad Houri

Reputation: 1207

make the text fill the entire label width?

I am using C# and .Net in a windows form application
and I have an Index
this index is an array of lines each line is a label on the Form
each label width is the same and must be the same with the Form width
and this index must appear on my form like this :
My form must look like this
my problem is :
i want the the "text" to be exactly on the left and the the "number" to be exactly on the right
each line must be only one label
and the big problem is that each char have a different width so i can't know how much i must fill between the text and the number to make each label look exactly as I want

Upvotes: 1

Views: 1139

Answers (1)

Reed Copsey
Reed Copsey

Reputation: 564373

each line must be only one label

While I think using 2 labels per "line" would be more elegant, you could solve this by having your labels use a fixed width font. This would make it so that each char was exactly the same width, and you could figure out how to "fill" appropriately.

Upvotes: 1

Related Questions