TextAlign property ?

Z

Z.K.

How does one align text in a textbox?

I tried this,
lblPrompt.TextAlign = ContentAlignment.MiddleCenter;

but it always displays to the far right. I even set it in the control's
property on the design form and still it goes way to the right. The
only way I was able to get it to work properly was to position the
control way to the left. Why is it when I center the control on the
form, the text that I send to the label will not align properly.


Z.K.
 
Z

Z.K.

Z.K. said:
How does one align text in a textbox?

I tried this,
lblPrompt.TextAlign = ContentAlignment.MiddleCenter;

but it always displays to the far right. I even set it in the control's
property on the design form and still it goes way to the right. The
only way I was able to get it to work properly was to position the
control way to the left. Why is it when I center the control on the
form, the text that I send to the label will not align properly.


Z.K.


Okay I finally got it to work by setting AutoSize = false. I really
think that I like MFC in C++ better than these forms in C#.

Z.K.
 
D

Duggi

Okay I finally got it to work by setting AutoSize = false.  I really
think that I like MFC in C++ better than these forms in C#.

     Z.K.

not really!!! it seems, you were more habituated to MFC... :-;

-Cnu
 
Z

Z.K.

Duggi said:
not really!!! it seems, you were more habituated to MFC... :-;

-Cnu

You are probably right. I guess I just need to get used to the .NET form.

Z.K.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top