September 7th, 2012, 09:29 AM
How to highlight a record in a MSHFlexGrid?
I have a MSHFlexGird (fgdCompany) and a search command. When the user enters the search data into "txtSearch", the command should search for the data and show it to the user by :
Highlighting the record in the MSHFlexGrid
By bringing the row that contains the searched data to the top of the MSHFlexGrid.
The code that I am using is given below. The search function works perfectly. Only thing is I can't make the record that contains the searched data be highlighted so that the user knows in which record the data that was search data is present. Can anybody could give me the code to highlight the record found in any of the two methods given above (preferably the first option).
Dim xString As String, xRow As Integer, xNext As Integer
xString = txtSearch.Text
For xNext = 0 To fgdCompany.Rows
fgdCompany.Row = xNext
xRow = fgdCompany.Row
If xString = fgdCompany.TextMatrix(xRow, 1) Then 'Assuming that the string to be searched is in coloumn 1...
myRow = fgdCompany.Row
September 7th, 2012, 12:10 PM
Re: How to highlight a record in a MSHFlexGrid?
You could try BackColor and TopRow property
... If your problem is fixed don't forget to mark your threads as resolved using the Thread Tools menu ...
Tags for this Thread
Click Here to Expand Forum to Full Width
This is a Codeguru.com survey!