Dim hg As Integer = sender.rows(sender.rows.count -1).Height \'控件高
If hg = -1 Then
hg = sender.rows(sender.rows.count -1).HeightDisplay
End If
Dim gh = sender.Height - 1
Select Case sender.ScrollBarsVisible \'显示了滚动条 0无 1横向 2纵向 3横纵
Case 1,3
gh = gh - 19
End Select
If sender.Controls.ContainsKey("Myhuizong") = False Then \'不存在汇总控件,则添加
Dim huizong As new C1.Win.C1FlexGrid.C1FlexGrid
With huizong
.name = "Myhuizong"
.BorderStyle = C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.None \'无边框
.Cols.Count = sender.Cols.Count
.rows.count = 2
.Rows(0).Height = 0 \'隐藏标题行
.Enabled = False \'不能使用控件
.styles.emptyarea.backcolor = sender.styles.emptyarea.backcolor
\'.FocusRect = C1.Win.C1FlexGrid.FocusRectEnum.None \'不显示焦点框
.HighLight = C1.Win.C1FlexGrid.HighLightEnum.Never \'不高亮显示选定区
End With
sender.Controls.add(huizong) \'加入控件
End If
Dim k As Integer = 2
Dim hui As C1.Win.C1FlexGrid.C1FlexGrid = sender.Controls("Myhuizong")
Select Case sender.ScrollBarsVisible \'显示了滚动条 0无 1横向 2纵向 3横纵
Case 0,2
hui.ScrollBars = 2
Case Else
hui.ScrollBars = 0
End Select
With hui \'调整位置
.left = 0
If sender.Rows(sender.Rows.count -1).Top < sender.Height - sender.rows(sender.rows.count -1).Height * 2 Then
.Top = sender.GetCellRect(sender.Rows.count-1, 1).y
Else
.top = gh - hg - 1
End If
.width = sender.width
.Height = hg + 2
.Rows(1).Height = hg
End With