Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

how to align text to center vertically in an edit control box

995 views
Skip to first unread message

Kai

unread,
May 8, 2009, 8:45:01 AM5/8/09
to
It seems text always align along top border vertically.

Ajay

unread,
May 8, 2009, 11:09:21 AM5/8/09
to
On May 8, 8:45 am, Kai <K...@discussions.microsoft.com> wrote:
> It seems text always align along top border vertically.

Deos ES_CENTER style do what you want?

--
Ajay

Kai

unread,
May 8, 2009, 11:28:01 AM5/8/09
to
No, it does horizontally

David Wilkinson

unread,
May 8, 2009, 11:57:02 AM5/8/09
to
Kai wrote:
> It seems text always align along top border vertically.

This is not possible without drawing the Edit control yourself, which is not easy.

Unless you want to try things like having a borderless edit control on top of a
static control with a border.

--
David Wilkinson
Visual C++ MVP

Joseph M. Newcomer

unread,
May 9, 2009, 4:58:00 PM5/9/09
to
There is no support for this. Once, a long time ago (Win16) I solved it by creating a
child edit control (a child of a child) which was borderless and vertically resized and
positioned. Frankly, the whole thing was more work than it was worth, and I doubt if I'd
ever try it again.
joe

On Fri, 8 May 2009 05:45:01 -0700, Kai <K...@discussions.microsoft.com> wrote:

>It seems text always align along top border vertically.

Joseph M. Newcomer [MVP]
email: newc...@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm

Scot T Brennecke

unread,
May 10, 2009, 2:16:58 AM5/10/09
to
Let's make sure we are asking the right questions here, though. What do you "really" want to do?
If you're using an edit control ust to display text with a border, that can be done with a static
control (with styles applied to it). I've had various success with modifying attributes of a font
and setting that control to use the modified font. You can also improve appearance sometimes by
changing the height of the edit box. But this all really comes down to answering the question,
"what's the real problem you're trying to solve?". Maybe the question you asked is limiting the
field for good answers.

"Kai" <K...@discussions.microsoft.com> wrote in message
news:154FB4F0-D622-4B80...@microsoft.com...

0 new messages