See Also

Page Class  | Page Members

Language

Visual Basic

C#

Show All

See Also Languages ActiveReports.Viewer Send feedback to Data Dynamics

MeasureParagraphHeight Method

Measures the height of the specified text if rendered using the current page settings with the specified width.
Measures the height of the specified text in a specified width at run time.

Overload List

Measures the height of the specified text in a specified width at run time.
Measures the height of the specified text in a specified width, font, and format at run time.

Return Type

A SizeF structure with the text's height and width in inches.

Remarks

Units are determined by the Page.Units property.

Example

[C#] 

private void arv_Load(object sender, System.EventArgs e) 

    rptDD rpt = new rptDD(); 
    rpt.Run(); 
    arv.Document = rpt.Document; 
 
    System.Drawing.SizeF x; 
         
    rpt.CurrentPage.Font = this.TextBox1.Font; 
    Console.WriteLine("TextBox1 Size = " + this.TextBox1.Size.ToString()); 
    string y; 
    y = "This is a really long textbox with text that should wrap multiple lines so I can then measure the height of the text using the MeasureParagrahHeight method off of the page object."; 
    x = arv.Document.Pages[0].MeasureParagraphHeight(y,this.TextBox1.Width); 
    Console.WriteLine("MPH = " + x.ToString()); 
    this.TextBox1.Size = x.ToSize(); 
    this.TextBox1.Text = y; 
}

[Visual Basic] 

Private Sub arv_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles arv.Load
    Dim rpt As New rptDD
    rpt.Run()
    arv.Document = rpt.Document

    Dim x As System.Drawing.SizeF

    rpt.CurrentPage.Font = Me.TextBox1.Font
    Console.WriteLine("TextBox1 Size = " + Me.TextBox1.Size.ToString())
    Dim y As String
    y = "This is a really long textbox with text that should wrap multiple lines so I can then measure the height of the text using the MeasureParagrahHeight method off of the page object."
    x = arv.Document.Pages(0).MeasureParagraphHeight(y, Me.TextBox1.Width)
    Console.WriteLine("MPH = " + x.ToString())
    Me.TextBox1.Size = x.ToSize()
    Me.TextBox1.Text = y
End Sub

See Also

Page Class  | Page Members

 

 


Copyright © 2004-2005 Data Dynamics, Ltd. All rights reserved.