我必须调用 MsFlexGrid 对象的单击事件。
Private Sub MSFlexGridboxcodelist_Click()
box_code = Trim(Me.MSFlexGridboxcodelist.TextMatrix(Me.MSFlexGridboxcodelist.RowSel, 1))
box_type = Trim(Me.MSFlexGridboxcodelist.TextMatrix(Me.MSFlexGridboxcodelist.RowSel, 7))
Me.Txtpack_weight.text = Trim(Me.MSFlexGridboxcodelist.TextMatrix(Me.MSFlexGridboxcodelist.RowSel, 5))
Dim x As Integer
For x = 0 To Me.Combobox_type.ListCount - 1
If Me.Combobox_type.List(x) = box_type Then
Me.Combobox_type.ListIndex = x
Exit For
End If
Next
End Sub
问题是当我实际点击 flexgrid 时,这部分工作正常:
Me.Combobox_type.ListIndex = x
但是当我这样做时:
Me.MSFlexGridboxcodelist.row = i
Me.MSFlexGridboxcodelist.TopRow = i
Me.MSFlexGridboxcodelist.RowSel = i
For x = 0 To Me.MSFlexGridboxcodelist.cols - 1
Me.MSFlexGridboxcodelist.ColSel = x
Next x
Call MSFlexGridboxcodelist_Click
未选择组合框中所需的项目。所以我猜这是点击某物和调用点击事件之间的区别,但我不知道是什么。我知道我可以将组合框的文本设置为我想要的任何内容,但是不应该允许用户这样做,所以我将它的样式属性设置为下拉列表。
你们能给我小费吗?
提前致谢。