Hi,
OK, after reading this thread and the replies, I've got a
thought on it, though I haven't tried it. What I would do in
this situation is to (if possible) figure out what the center
would be based on the width of the control, set the
alignment to left, and add the appropriate amount of
spaces to the beginning of the text in both controls. I did
try adding the spaces, and this seems to work.
Now, you might not get it *exactly* in the center every
time, but with some fiddling I'm sure you could find a way
to calculate it so that each one had the same amount of
leading spaces when resized or whatever. That is, as
long as BOTH controls are aligned with one another. If
that's not a feasible alternative, then I'm sorry, but right
now that is the only way I can see to handle it correctly.
Beyond that, It's anybody's guess!
"Mark Urish" <an*******@discussions.microsoft.com> wrote in message
news:E7**********************************@microsof t.com...
I want to center-align the text in 2 Label controls, and I want the 1st
char of their text to line up: --------------------------------------------------------------------------
----- label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
label1.Text = "IDLE"; //4 char string
label2.Text = "RUN ";//4 char string,
//but trailing space ignored and it is
centered as though //it has only 3 chars.
--------------------------------------------------------------------------
-----
Is there a way to make the Label control center "Run " (with a trialing
space) as though it is 4 chars long?
thanks,
Mark Urish