|
-
Sep 11th, 2024, 12:14 PM
#1
Thread Starter
Member
vsFlexGrid FindRow property seems buggy
I have used vsFlexGrid, both the original VideoSoft product and the ComponentOne product, for years. Recently I wanted to find a row based on a partial match of the contents of a cell in a particular column.
My example below uses vsFlexGrid 8.0 (OLEDB) version 8.0.20033.190.
According to the documentation for FindRow, there are two boolean flags, CaseSensitive and FullMatch. Both flags are True by default.
The syntax of the FindRow property is:
val& = [form!]VSFlexGrid.FindRow(Item As Variant, [ Row As Long ], [ Col As Long ], [ CaseSensitive As Boolean ], [ FullMatch As Boolean])
Create a test VB6 program.
Add ComponentOne vsFlexGrid 8.0 (OLEDB) from the Components list. Name it fg.
Add a Command button (Command1).
Add the code below to the Click event. This code is based on the example given in the help file for FindRow. I want to find "Cell" or "cell", which is embedded in the string "MyCell". I cannot get FindRow to find it.
Private Sub Command1_Click()
fg.TextMatrix(2, 5) = "MyCell"
' All tests below return -1
' It is impossible to find "Cell" with any combination of CaseSensitive and FullMatch
' Test find "Cell" (with C in upper case)
Debug.Print fg.FindRow("Cell", , 5, False, False)
Debug.Print fg.FindRow("Cell", , 5, False, True)
Debug.Print fg.FindRow("Cell", , 5, True, False)
Debug.Print fg.FindRow("Cell", , 5, True, True)
' Test find "cell" (with c in lower case)
Debug.Print fg.FindRow("cell", , 5, False, False)
Debug.Print fg.FindRow("cell", , 5, False, True)
Debug.Print fg.FindRow("cell", , 5, True, False)
Debug.Print fg.FindRow("cell", , 5, True, True)
End Sub
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|