CRichEditCtrl Vertical alignment

Good day:

I have a CRichEditCtrl 2.0 on a dialog. It 'is' multiline, however it will be rare if ever that the text will be vertically to large for the control, although it 'might' happen when the application is localized to other languages. There is no horizontal scrollbar in this control and the words will wrap to the next line if they reach the horizontal limit.

The issue is that I need to Vertically Align the block of text within the control. I can probably rig something up if there is a descent way to measure the overall height of the text block. (then I can set the text rect to that height and set the top point of the text block to lower in the control to make it appear centered.

Who is Participating?

obtain text block height with above functions....obtain window rect of CRichEditCtrl..compare both rects..you will come to know how many lines of text is there..then you may be able to obgtain total text height equal to single text(or character ) height multiplied by number of lines...