窗体加一mshflexgrid和text.box 就可以了。Option ExplicitPrivate Sub Form_Load() Dim i As Integer Dim j As Integer With MSHFlexGrid1 .Rows = 5 .Cols = 5 For i = 1 To 5 - 1 For j = 1 To 5 - 1 .TextMatrix(i, j) = i Next Next End With End SubPrivate Sub MSHFlexGrid1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
If Button = 1 Then '鼠标单击 With MSHFlexGrid1 If .Row > 0 And .Col > 0 Then Text1.Text = .TextMatrix(.Row, .Col) End If End With End If End Sub
GRID有多个单元格,TEXT只有一个.
你是要把整个GRID所有单元格的内容合并到一个TEXT里面么?文本有change事件是因为TEXT是可以编辑的,GRID没有这个事件是因为GRID是不可编辑的
,yao1mshflexgrid1的最后行内容在text.box 文本框同样显示方法。
mshflexgrid内容改变时,text.box 内容同样改变显示作用。
mshflexgrid数据是怎么获取的?
With MSHFlexGrid1
Text14.Text = .TextMatrix(.Rows - 1, 2)
Text16.Text = .TextMatrix(.Rows - 1, 3)
Text17.Text = .TextMatrix(.Rows - 1, 4)
Text18.Text = .TextMatrix(.Rows - 1, 5)
Text19.Text = .TextMatrix(.Rows - 1, 6)
End With mshflexgrid1的最后行内容同步显示在 本本框里。
textbox要显示全部还是部分?具体点
我再次问一下, 如果,两个mshflexgr时,第一个mshflexgrid1的内容跟随第二个mshflexgrid2上同步更新显示要怎么做呢
Dim i As Integer
Dim j As Integer
With MSHFlexGrid1
.Rows = 5
.Cols = 5
For i = 1 To 5 - 1
For j = 1 To 5 - 1
.TextMatrix(i, j) = i
Next
Next
End With
End SubPrivate Sub MSHFlexGrid1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
If Button = 1 Then '鼠标单击
With MSHFlexGrid1
If .Row > 0 And .Col > 0 Then
Text1.Text = .TextMatrix(.Row, .Col)
End If
End With
End If
End Sub