Spread Windows Forms 6.0 Product Documentation
GetPreferredPrintRowHeight Method
See Also  Example Support Options
FarPoint.Win.Spread Assembly > FarPoint.Win.Spread Namespace > SheetView Class : GetPreferredPrintRowHeight Method

Graphics device
Row index

Glossary Item Box

Gets the height in pixels of the tallest cell (based on text contents) in the specified row on this sheet.


Visual Basic (Declaration) 
Public Function GetPreferredPrintRowHeight( _
   ByVal g As Graphics, _
   ByVal row As Integer _
) As Single
Visual Basic (Usage)Copy Code
Dim instance As SheetView
Dim g As Graphics
Dim row As Integer
Dim value As Single
value = instance.GetPreferredPrintRowHeight(g, row)
public float GetPreferredPrintRowHeight( 
   Graphics g,
   int row


Graphics device
Row index

Return Value

Single-precision, floating-point number of in pixels of the height in the tallest cell (based on text contents)


This example returns the height of tallest cell (based on text contents) in the first row on this sheet.
C#Copy Code
private void GetPrintHeight(Graphics g, float pwidth, FarPoint.Win.Spread.SheetView sheet) 
      sheet = fpSpread1.ActiveSheet; 
      pwidth = sheet.GetPreferredPrintRowHeight(g, 0); 

private void button1_Click(object sender, System.EventArgs e)
      Graphics g;
      float pw = 0;
      g = fpSpread1.CreateGraphics();
      GetPrintHeight(g, pw, fpSpread1.ActiveSheet); 
Visual BasicCopy Code
Private Sub GetPrintHeight(ByVal g As Graphics, ByVal pwidth As Single, ByVal sheet As FarPoint.Win.Spread.SheetView) 
      sheet = FpSpread1.ActiveSheet 
      pwidth = sheet.GetPreferredPrintRowHeight(g, 0) 
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
      Dim g As Graphics
      Dim pw As Single
      g = FpSpread1.CreateGraphics()
      GetPrintHeight(g, pw, FpSpread1.ActiveSheet)
End Sub


Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also


SheetView Class
SheetView Members

User-Task Documentation

Managing Printing

© 2002-2012 ComponentOne, a division of GrapeCity. All Rights Reserved.