例如:
Private Sub MSFlexGrid1_Compare(ByVal Row1 As Long, ByVal Row2 As Long, Cmp As Integer)
Dim str1 As String, str2 As String
str1 = MSFlexGrid1.TextMatrix(Row1, 0)
str2 = MSFlexGrid1.TextMatrix(Row2, 0)
If CDbl(str1) > CDbl(str2) Then
Cmp = -1
Else
Cmp = 1
End If
End Sub