option explicit dim currentrow as integer private sub form_load() dim i as integer, j as integer with mshflexgrid1 .rows = 10 .cols = 4 for i = 1 to 9 .textmatrix(i, 0) = "第 " & i & " 行" for j = 1 to 3 .textmatrix(0, j) = "第 " & j & " 列" .textmatrix(i, j) = i & "," & j next next end with end sub private sub mshflexgrid1_mousedown(button as integer, shift as integer, x as single, y as single) with mshflexgrid1 .row = .mouserow currentrow = .row .col = 0 .colsel = .cols - 1 end with end sub private sub mshflexgrid1_mouseup(button as integer, shift as integer, x as single, y as single) with mshflexgrid1 .rowsel = currentrow .colsel = .cols - 1 end with end sub