in

C1 Community

ComponentOne Community is a free source for developers and help authors to collaborate and communicate.

How do I align my text from right to left?

Last post 02-20-2008 5:48 AM by C1_GaryB. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 02-19-2008 5:21 PM

    How do I align my text from right to left?

    I tried the code below but nothing happens. It works for center and nothing else.

     

    rc.Height = Pdf.MeasureString("test is the longest student name ever", fnt, rc.Width).Height

    Dim sf As New StringFormat(StringFormatFlags.DirectionRightToLeft)

    'sf.Alignment = StringAlignment.Center

    'sf.Alignment = StringAlignment.Near

    'sf.Alignment = StringAlignment.Far

    Pdf.DrawString("This should be right aligned", bldfnt, Brushes.Black, rc, sf)

  • 02-20-2008 5:48 AM In reply to

    Re: How do I align my text from right to left?

    Hi,
     
    I have created a small sample for your using the alignment feature and it does work on my side. Just download the sample and try changing the values and you will find the change in result too. Here is the code that I have used -
     
      Dim sf As New StringFormat()
      sf.Alignment = StringAlignment.Center
      sf.LineAlignment = StringAlignment.Near
     
    This should help you to align your lines as per your needs.
     
    Thanks,
    Gary.
     
    <mattphung> wrote in message news:202071@10.0.1.98...

    I tried the code below but nothing happens. It works for center and nothing else.

     

    rc.Height = Pdf.MeasureString("test is the longest student name ever", fnt, rc.Width).Height

    Dim sf As New StringFormat(StringFormatFlags.DirectionRightToLeft)

    'sf.Alignment = StringAlignment.Center

    'sf.Alignment = StringAlignment.Near

    'sf.Alignment = StringAlignment.Far

    Pdf.DrawString("This should be right aligned", bldfnt, Brushes.Black, rc, sf)



    http://helpcentral.componentone.com/cs/forums/p/74371/202071.aspx#202071

Page 1 of 1 (2 items)
Contact ComponentOne: 1.800.858.2739 ©1987-2008 ComponentOne LLC All Rights Reserved.