ActiveReports 2.0 (Visual Basic 6.0) Support

Started by Blue Streak at 06-18-2009 9:22 AM. Topic has 2 replies.

Print Search Rate
Sort Posts:    
   06-18-2009, 9:22 AM
Blue Streak is not online. Last active: 6/23/2009 9:42:46 PM Blue Streak

Not Ranked
Joined on 06-18-2009
Posts 2
AR2 RichEdit Control, Vertical Alignment
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...
   Report 
   06-18-2009, 11:03 PM
PrantikS is not online. Last active: 3/17/2010 9:25:56 PM PrantikS

Top 25 Posts
Joined on 12-11-2008
Posts 767

DDStaff
Re: AR2 RichEdit Control, Vertical Alignment

Attachment: RichText at the center.zip
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
   Report 
   06-23-2009, 8:50 AM
Blue Streak is not online. Last active: 6/23/2009 9:42:46 PM Blue Streak

Not Ranked
Joined on 06-18-2009
Posts 2
Re: AR2 RichEdit Control, Vertical Alignment
Thank you.
   Report 
GrapeCity » Product Support » ActiveReports 2... » Re: AR2 RichEdit Control, Vertical Alignment

Privacy Policy | Copyright © 1997-2010 - GrapeCity, inc.