界面上放combo visible =false
msflexgrid.selectcell 中,计算combo 位置 并visible =ture

解决方案 »

  1.   

    Private Sub MSFlexGrid1_Click()
        Dim c As Integer
        Dim r As Integer
        
        With MSFlexGrid1
            c = .Col
            r = .Row
            Combo1.Left = MSFlexGrid1.Left + MSFlexGrid1.ColPos(c)
            Combo1.Top = MSFlexGrid1.Top + MSFlexGrid1.RowPos(r)
            If .Appearance = 1 Then
                Combo1.Left = Combo1.Left + 2 * Screen.TwipsPerPixelX
                Combo1.Top = Combo1.Top + 2 * Screen.TwipsPerPixelY
            End If
            Combo1.Width = .ColWidth(c)
            Combo1.Height = .RowHeight(r)
            Combo1.Text = .Text
        End With
        Combo1.Visible = True
        Combo1.SetFocus
    End Sub