AR2 RichEdit Control, Vertical Alignment
ActiveReports 2.0 (Visual Basic 6.0) Support
AR2 RichEdit Control, Vertical Alignment
06-18-2009, 9:22 AM
I am posting this message on behalf of another programmer. This programmer is trying to generate a report utilizing AR2. In this report he has several RichEdit controls where he wants to be able to vertically center the text in the box. I have tried to help him by researching this topic but to no avail.
I know that this object doesn’t have a VerticalAlignment property of its own so this approach has to be done manually by writing our own function. However, I am personally not very familiar with AR2 myself. Does anyone have any suggestions?
TIA...
Re: AR2 RichEdit Control, Vertical Alignment
06-18-2009, 11:03 PM
Hello,
In order to vertically align the text of the RichTextBox, you may add the following lines of code.
Private Sub Detail_Format ()
Me.RichEdit1.Width = Me.PrintWidth
Me.RichEdit1.SelAlignment = rtfCenter
If Me.Detail.Height < Me.RichEdit1.Height Then
Me.Detail.Height = Me.RichEdit1.Height
End If
End Sub
Private Sub Detail_BeforePrint ()
Me.RichEdit1.Top = (Me.Detail.Height - Me.RichEdit1.Height) / 2
End Sub
Please take a look at the attached sample in this regard.
Regards,
Prantik
Re: AR2 RichEdit Control, Vertical Alignment
06-23-2009, 8:50 AM
Thank you.