lifesky2006,
你可以使用 ColHeaderRows 属性,参考代码如下:
- Private Sub Form_Load()
- ' Set number of columns and rows
- fpSpread1.MaxCols = 6
- fpSpread1.MaxRows = 250
- ' Turn off display of row headers
- fpSpread1.RowHeadersShow = False
- ' Set up column headers
- fpSpread1.ColHeaderRows = 3
- fpSpread1.AddCellSpan 1, SpreadHeader, 3, 1
- fpSpread1.AddCellSpan 4, SpreadHeader, 3, 1
- fpSpread1.Col = 1
- fpSpread1.Row = SpreadHeader
- fpSpread1.Text = "National Parks"
- fpSpread1.Col = 4
- fpSpread1.Row = SpreadHeader
- fpSpread1.Text = "State Parks"
- fpSpread1.Col = 1
- fpSpread1.Row = SpreadHeader + 1
- fpSpread1.Text = "Name"
- fpSpread1.Col = 2
- fpSpread1.Row = SpreadHeader + 1
- fpSpread1.Text = "State"
- fpSpread1.Col = 3
- fpSpread1.Row = SpreadHeader + 1
- fpSpread1.Text = "Size (Acres)"
- fpSpread1.Col = 4
- fpSpread1.Row = SpreadHeader + 1
- fpSpread1.Text = "Name"
- fpSpread1.Col = 5
- fpSpread1.Row = SpreadHeader + 1
- fpSpread1.Text = "State"
- fpSpread1.Col = 6
- fpSpread1.Row = SpreadHeader + 1
- fpSpread1.Text = "Size (Acres)"
- ' Display sorting indicator in lowest header row for
- ' Name columns
- fpSpread1.UserColAction = UserColActionSort
- fpSpread1.ColUserSortIndicator(2) = ColUserSortIndicatorDescending
- fpSpread1.ColHeadersUserSortIndex = 1
- End Sub
复制代码 |