Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

remove highlighting from MSFlexGrid 1

Status
Not open for further replies.

iojbr

Technical User
Feb 12, 2003
129
US
Hi:

I used the following code (listed below) to transfer rows of data between two MSFlexGrids located on the same VB form using a mouse_Down subroutine. The row transfer was fine, but I got an undesired effect in that when I select the row I want to transfer by holding down the mouse button, all the rows preceding the one to be transferred, including the fixed row, become highlighted, and remain so after the transfer event. The only cell that isn't highlighted is col 0, row 1. Is there any way to prevent the highlighting? Thank you for your help in advance.



Private Sub MSFlexGrid2_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
MoveBetweenGrids MSFlexGrid2, MSFlexGrid1
End Sub


Private Sub MSFlexGrid1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
MoveBetweenGrids MSFlexGrid1, MSFlexGrid2
End Sub


Private Sub MoveBetweenGrids(ByVal flxFrom As MSFlexGrid, _
ByVal flxTo As MSFlexGrid)
Dim from_row As Integer
Dim to_row As Integer
Dim c As Integer
from_row = flxFrom.Row
to_row = flxTo.Rows
flxTo.Rows = to_row + 1
For c = 0 To 2
flxTo.TextMatrix(to_row - 1, c) = _
flxFrom.TextMatrix(from_row, c)
Next c
flxFrom.RemoveItem from_row
flxFrom.Row = 0
flxTo.Row = 0
End Sub
 
Hi

It sounds like you may have MSFlexgrid.AllowBigSelection property set to true.

Try it Set to False.

hope this helps

Bob
 
Thanks for the help tudogs. I set the the AllowBigSelection property to false, but I still got the same result. However, just by dumb luck, I was able to fix the problem by deleting the last two rows (flxFrom.Row = 0 and flxTo.Row = 0) of the MoveBetweenGrids sub. Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top