Dim V_select_enum As IEnumerator 'Enum 列舉所有被選取的範圍
V_select_enum = DGV.SelectedCells.GetEnumerator
While V_select_enum.MoveNext()
If X2 < V_select_enum.Current.columnindex Then
X2 = V_select_enum.Current.columnindex
End If
If Y2 < V_select_enum.Current.rowindex Then
Y2 = V_select_enum.Current.rowindex
End If
If X1 > V_select_enum.Current.columnindex Then
X1 = V_select_enum.Current.columnindex
End If
If Y1 > V_select_enum.Current.rowindex Then
Y1 = V_select_enum.Current.rowindex
End If
End While
DGV_location1(0) = X1
DGV_location1(1) = Y1
DGV_location2(0) = X2
DGV_location2(1) = Y2
沒有留言:
張貼留言