AutoHeightRow have been enhanced to take into account real cell row (but only for visiable cell).
3rd parameter
use valuefalse to have same behavior as sgrid2. (default)use value
true to check height of each visible cell, take into account icon size, multi-line cell... (recommanded)Tool to play with it
I made a little program where you can play with :- font size,
- cell
TextAlignproperty
You can download it here (with sources)
Source
Here is the source of the new AutoHeightRow :
Public Function AutoHeightRow(ByVal lRow As Long, Optional ByVal lMinimumHeight As Long = -1,
Optional ByVal bWithTextRow As Boolean = False) As Long
Dim lCol As Long
Dim lHeight As Long
Dim lMaxHeight As Long
' abs grid 1.6 @fab2006
If bWithTextRow And (lRow > 0) And (lRow <= m_iRows) Then
lMaxHeight = AutoHeightRow(lRow) ' le reste de la ligne
lCol = m_iCols
If m_tCols(lCol).bRowTextCol And m_tCols(lCol).bVisible Then ' visible et bien la bonne colonne :)
lHeight = lHeight + EvaluateTextHeight(lRow, lCol) ' la col en mode 'textRow'
If (m_tCells(lCol, m_tRows(lRow).lGridCellArrayRow).iIconIndex >= 0) Then
If lHeight < m_lIconSizeY Then
lHeight = m_lIconSizeY
End If
End If
lMaxHeight = lMaxHeight + lHeight
End If
RowHeight(lRow) = lMaxHeight
AutoHeightRow = lMaxHeight
Exit Function
End If
' ^^ abs grid
If lMinimumHeight <= 8 Then
lMinimumHeight = m_lDefaultRowHeight
If lMinimumHeight <= 8 Then
lMinimumHeight = 8
End If
End If
If (lRow > 0) And (lRow <= m_iRows) Then
For lCol = 1 To m_iCols
If (m_tCols(lCol).bVisible) Then 'abs grid 3 : bug fix @fab2006
If Not (m_tCols(lCol).bRowTextCol) Then ' abs grig 0.6 : bug fix @fab2006
lHeight = EvaluateTextHeight(lRow, lCol)
If (m_tCells(lCol, m_tRows(lRow).lGridCellArrayRow).iIconIndex >= 0) Then
If lHeight < m_lIconSizeY Then
lHeight = m_lIconSizeY
End If
End If
Else
lHeight = 0
End If
If (lHeight < lMinimumHeight) Then
lHeight = lMinimumHeight
End If
If (lHeight > lMaxHeight) Then
lMaxHeight = lHeight
End If
End If
Next lCol
RowHeight(lRow) = lMaxHeight + Abs(m_bGridLines And Not (m_bNoHorizontalGridLines)) * 2 + 2
AutoHeightRow = RowHeight(lRow) ' absgrid 1.6 @fab2006 : return calculated height for this row
Else
gErr 9, "Row subscript out of range"
End If
End Function
return to mainAbsGrid page
