Private Sub Form_Load()
With presentation_search.presentationCollection_grid
.TextMatrix(0, 1) = "Presentation ID"
.TextMatrix(0, 2) = "Presentation Name"
.TextMatrix(0, 3) = "Presentation Type"
end with
end sub
Private Sub presentationCollection_grid_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
' If this is not row 0, do nothing.
If presentationCollection_grid.MouseRow <> 0 Then
Exit Sub
End If
' Sort by the clicked column.
SortByColumn presentationCollection_grid.MouseCol
End Sub
' Sort by the indicated column.
Private Sub SortByColumn(ByVal sort_column As Integer)
presentationCollection_grid.Visible = False
presentationCollection_grid.Refresh
' Sort using the clicked column.
presentationCollection_grid.Col = sort_column
presentationCollection_grid.ColSel = sort_column
presentationCollection_grid.Row = 0
presentationCollection_grid.RowSel = 0
' If this is a new sort column, sort ascending.
' Otherwise switch which sort order we use.
If m_SortColumn <> sort_column Then
m_SortOrder = flexSortGenericAscending
ElseIf m_SortOrder = flexSortGenericAscending Then
m_SortOrder = flexSortGenericDescending
Else
m_SortOrder = flexSortGenericAscending
End If
presentationCollection_grid.Sort = m_SortOrder
' Restore the previous sort column's name.
If m_SortColumn >= 0 Then
presentationCollection_grid.TextMatrix(0, m_SortColumn) = Mid$(presentationCollection_grid.TextMatrix(0, m_SortColumn), 3)
End If
' Display the new sort column's name.
m_SortColumn = sort_column
If m_SortOrder = flexSortGenericAscending Then
presentationCollection_grid.TextMatrix(0, m_SortColumn) = "> " & presentationCollection_grid.TextMatrix(0, m_SortColumn)
Else
presentationCollection_grid.TextMatrix(0, m_SortColumn) = "< " & presentationCollection_grid.TextMatrix(0, m_SortColumn)
End If
Debug.Print sort_column; presentationCollection_grid.Col; m_SortColumn '@
' Display the FlexGrid.
presentationCollection_grid.Visible = True
End Sub