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
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