TextBox has different heights by default, depending on the font size. I've been able to resize the text boxes by turning off AutoSize, but the text still hugs the top of the control, leaving a gap below. How could I obtain a VerticalAlignment property?

Recommended Answers

All 4 Replies

I m not sure what you want but first of all PROPERTY AutoSize does not exist (using 2012 VS).However there is a property called MultiLine and if you set it to true your text(string) will go down after it reaches the border of the textbox, it will go in the second line.

I'm using VS 2010 and although AutoSize is not available in the properties list, you can set it from your code. The multiline does the same thing. Text still hungs at the top of the Textbox.

Anyway, I managed to obtain what I was looking for by drawing a rectangle around my TextBox .

Did you ever tried a DataGridView?

It's just a simple login form. It didn't cross my mind to use a DataGridView.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.