Overload | Description |
---|---|
MeasureParagraphHeight(String,Single) | Measures the height of the specified text in a specified width at run time. |
MeasureParagraphHeight(String,Single,Font,StringFormat) | Measures the height of the specified text in a specified width, font, and format at run time. |
Units are determined by the Page.Units property.
C# | Copy Code |
---|---|
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 | Copy Code |
---|---|
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 |