在MSFlexGrid控件中每一列
  1、有些行通过文本框输入数字
 2、有些行必须通过下拉框选择几种固定的选项

解决方案 »

  1.   

    作个下拉框,放在需要的对应格内,然后选择,将值传入msflexgrid,将下拉框隐藏
      

  2.   

    应该是在一个RowColChange事件里判断当前单元格是要显示Text还是Combo,然后再根据CellLeft,CellTop,CellWidth,CellHeight属性移动到合适的位置。
      

  3.   

    界面上添加控件
    mshflexgrid1 '属性不变
    text1,combo1 'VISIBLE = FALSE代码如下:
    Private Sub Combo1_Click()
        Combo1.Visible = False
    End SubPrivate Sub MSHFlexGrid1_Click()
        With Me.MSHFlexGrid1
            If .Col = 1 Then
                Text1.Appearance = 0
                Text1.BorderStyle = 0
                Text1.Visible = True
                Text1.Move .Left + .CellLeft, .Top + .CellTop, .CellWidth, .CellHeight
                Text1.SetFocus
            End If
            
            If .Col = 2 Or .Col = 3 Then
                Combo1.Appearance = 0
                Combo1.Visible = True
                Combo1.Move .Left + .CellLeft, .Top + .CellTop, .CellWidth
                Combo1.SetFocus
            End If
        End With
    End SubPrivate Sub Text1_LostFocus()
        Text1.Visible = False
    End Sub
      

  4.   

    按照你的需求,只要用COMBO控件就可以了,COMBO可以只选,也可以接受用户输入,只需要设置COMBO的STYLE属性就可以改变了。