1

Is it possible to center text vertically in an edit control in pure win32 api ? The controls are already super-classed so a sub/super classing solution is not a problem. But shifting/changing to some custom control is not an option.

I am working in c++;

StudentX
  • 2,243
  • 6
  • 35
  • 67

2 Answers2

2

You'll have to do so manually by inserting the appropriate number of spaces.

"RichEdit" is the appropriate Win32 control if you want to center text.

MSalters
  • 173,980
  • 10
  • 155
  • 350
-2

You can apply the ES_CENTER window style to an EDIT control. If it has the ES_MULTILINE window style, all of its lines will be centered.

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770