'排序函數 Public Sub Sort(sgrd As MSHFlexGrid, Y As Single) With sgrd If Y < sgrd.CellHeight Then If Right(.TextMatrix(0, .Col), 1) = STR_SORT_ASC Then .Sort = flexSortGenericAscending .TextMatrix(0, .Col) = Replace(.TextMatrix(0, .Col), STR_SORT_ASC, STR_SORT_DESC) ElseIf Right(.TextMatrix(0, .Col), 1) = STR_SORT_DESC Then .Sort = flexSortGenericDescending .TextMatrix(0, .Col) = Replace(.TextMatrix(0, .Col), STR_SORT_DESC, STR_SORT_ASC) Else .Sort = flexSortGenericDescending .TextMatrix(0, .Col) = .TextMatrix(0, .Col) & STR_SORT_ASC End If .Tag = .Col End If End With End Sub
Public Sub Sort(sgrd As MSHFlexGrid, Y As Single)
With sgrd
If Y < sgrd.CellHeight Then
If Right(.TextMatrix(0, .Col), 1) = STR_SORT_ASC Then
.Sort = flexSortGenericAscending
.TextMatrix(0, .Col) = Replace(.TextMatrix(0, .Col), STR_SORT_ASC, STR_SORT_DESC)
ElseIf Right(.TextMatrix(0, .Col), 1) = STR_SORT_DESC Then
.Sort = flexSortGenericDescending
.TextMatrix(0, .Col) = Replace(.TextMatrix(0, .Col), STR_SORT_DESC, STR_SORT_ASC)
Else
.Sort = flexSortGenericDescending
.TextMatrix(0, .Col) = .TextMatrix(0, .Col) & STR_SORT_ASC
End If
.Tag = .Col
End If
End With
End Sub