title: Call msflexgrid click event in vb6
body: <p>I've got to call the click event for an MsFlexGrid object.</p>
  
  <pre><code>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
  </code></pre>
  
  <p>The problem is when I actually click on the flexgrid, this part works as it should:</p>
  
  <pre><code>Me.Combobox_type.ListIndex = x
  </code></pre>
  
  <p>But when I do this:</p>
  
  <pre><code>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
  </code></pre>
  
  <p>The needed item in the combobox is not selected. So I guess the is a difference between clicking on something and calling the click event, but I have no clue what.
  I know I could just set the text of the combobox to whatever I want, but users shouldn't be allowed do it, so I set it's style attribute to Dropdown list.</p>
  
  <p>Could you guys give me tip?</p>
  
  <p>Thanks in advance.</p>