Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Vertical Center text in TextBox

Status
Not open for further replies.

Sorwen

Technical User
Nov 30, 2002
1,641
US
This is really just to visually cleanup the look of my forms abit, but there doesn't seem to be a way to Center text vertically in a textbox like you can in a label. Is that correct?

-I hate Microsoft!
-Forever and always forward.
 
As far as i know, this is not possible. But why doing this? I dont think that this will make the layout more beautiful..
 
Because all of the labels are set to vert center with a line around the text box. I have a few to many (depends) TextBoxes that look like labels part of the time and it looks wrong/sticks out. If it was possible I wanted them to look the same. Not really important, just looks odd.

-I hate Microsoft!
-Forever and always forward.
 
You could create a user control with a textbox on it (not inherit from it).. Have it vertically centered with docking to none. Last use the paint event of the usercontrol and use e.graphics to draw a rectangle ...

Hope this Helps!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top