How To…Vertically Center Memo Text


“How can I vertically center text in a memo?”


Report output consists of a collection of Page.DrawCommands[]. Each time the Memo, generates, it creates a DrawCommand that describes the location and content to be rendered. We can use the Memo.OnDrawCommandCreate event to modify the DrawCommand. We can vetically center the wrapped text by inserting some empty lines.


Sample Delphi code: