|
-
September 13th, 1999, 11:09 AM
#1
How to send messages to Grid Control
Hi,
I want to send messages to MSFlexGrid using SendMessage API. What is the Constant do i need to use in wParam Parameter. Any help is much appreciated. Tx in advance
Giri
-
September 14th, 1999, 01:20 AM
#2
Re: How to send messages to Grid Control
the values for wParam and lParam are message specific, i.e. depending on the message you want to send, you'll have to spend different parameters.
So tell us what message you want to send.
-
September 14th, 1999, 08:28 AM
#3
Re: How to send messages to Grid Control
I want to find particular value say a string "abc" in the cell 1,1(Is there any msg like LB_FINDSTRING!)
-
September 14th, 1999, 08:56 AM
#4
Re: How to send messages to Grid Control
Rather than relying on a message/api solution and I couldn't find anything on messages for the FlexGrid in the VC++ headers), couldn't you just use a routine similar to the one below ? :
private Function FindInGrid(byval sText as string, _
optional lColumn as Long = -99)
'
Dim lRowCount as Long
Dim lRows as Long
Dim lColCount as Long
Dim lStartRow as Long
'
If lColumn < 0 then
lColumn = 0
End If
'
With MSFlexGrid1
.Redraw = false
lRows = .Rows - 1
lStartRow = .FixedRows
'
for lRowCount = lStartRow to lRows
'
If InStr(1, .TextMatrix(lRowCount, _
lColumn), sText, vbTextCompare) then
'
FindInGrid = lRowCount
.Redraw = true
Exit Function
End If
'
next
.Redraw = false
End With
'
FindInGrid = -1 ' not found
'
End Function
This routine will return the row number of the row where the text was found for the specified column.
I ran this code on 1000 rows in a flexgrid and it found a match in under 0.5 seconds.
Chris Eastwood
CodeGuru - the website for developers
http://codeguru.developer.com/vb
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
|