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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Edit Control Alignment

Status
Not open for further replies.

OneSource

Programmer
Jun 18, 2002
22
US
Hi .....

How do I center text in a multiline edit control vertically? In other words, I want the text to appear in the middle of the edit control's entire window instead of on the first line.

Thanks,

OneSource
 
There's no easy way to do it (i.e. no edit style that has that effect), I suggest writing a function to calculate and insert the necessary number of Carriage Returns to center the text, whenever it is modified.
 
If you really need the text centered you will have to "paint" or draw it yourself. Counting lines will only approximate centering.

-pete
 
apatterno and palbano, thanks for your replies. Since "there's no easy way to do it", I won't worry about it. After all, I am a beginner in VC++ programming! :)

Thanks again,

OneSource
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top