请问怎么设置MSFlexGrid的一列为ComboBox,一列为CheckBox,一列为Button?

解决方案 »

  1.   

    VSFlexGrid我只知道做复选筐的,把cellDataType设置成boolean就行了,其他的不知道,
    guyehanxinlei(孤夜寒心泪)
    指点指点
      

  2.   

    Option ExplicitPrivate Sub fg_BeforeMouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single, Cancel As Boolean)
        
        ' only interesetd in left button
        If Button <> 1 Then Exit Sub
        
        ' get cell that was clicked
        Dim r&, c&
        r = fg.MouseRow
        c = fg.MouseCol
        
        ' make sure the click was on the sheet
        If r < 0 Or c < 0 Then Exit Sub
        
        ' make sure the click was on a cell with a button
        If Not (fg.Cell(flexcpPicture, r, c) Is imgBtnUp) Then Exit Sub
        
        ' make sure the click was on the button (not just on the cell)
        ' note: this works for right-aligned buttons
        Dim d!
        d = fg.Cell(flexcpLeft, r, c) + fg.Cell(flexcpWidth, r, c) - X
        If d > imgBtnDn.Width Then Exit Sub
        
        ' click was on a button: do the work
        fg.Cell(flexcpPicture, r, c) = imgBtnDn
        MsgBox "Thanks for clicking my custom button!"
        fg.Cell(flexcpPicture, r, c) = imgBtnUp
        
        ' cancel default processing
        ' note: this is not strictly necessary in this case, because
        '       the dialog box already stole the focus etc, but let's be safe.
        Cancel = TrueEnd SubPrivate Sub Form_Load()    ' initialize grid
        fg.Editable = flexEDKbdMouse
        fg.AllowUserResizing = flexResizeBoth
        
        ' add some buttons to the grid
        Dim i%
        For i = 2 To 6
            fg.Cell(flexcpPicture, i, 2) = imgBtnUp
            fg.Cell(flexcpPictureAlignment, i, 2) = flexAlignRightCenter
        Next
        
    End SubPrivate Sub Form_Resize()
        On Error Resume Next
        fg.Move fg.Left, fg.Top, ScaleWidth - 2 * fg.Left, ScaleHeight - fg.Left - fg.Top
    End Sub
      

  3.   

    guyehanxinlei(孤夜寒心泪)
    程序在“imgBtnUp”处出错,说它没定义,要怎么定义?
      

  4.   

    vsflexgrid的按钮效果是,combosearch设置3 editable设置为2 showcombobutton设置为2
    下拉框效果设置 ColComboList的值类似a|b|c就有a b c三个下来选项