tenta ai
Const strChecked = "þ"
Const strUnChecked = "q"
Private Sub Form_Load()
With MSFlexGrid1
.Rows = 10
.Cols = 3
.AllowUserResizing = flexResizeBoth
'Nome das Colunas
For i = 1 To .Cols - 1
.Row = 0
.Col = i
.Text = Chr(i + 64)
Next i
'Nome das Linhas
For i = 1 To .Rows - 1
.Col = 0
.Row = i
.Text = "Linha " & i
Next i
'Define os campos como CheckBox
For y = 1 To .Rows - 1
.Row = y
.Col = 0
.CellFontName = "Wingdings"
.CellFontSize = 14
.CellAlignment = flexAlignCenterCenter
.Text = strUnChecked
Next y
End With
End Sub
Private Sub Form_Resize()
MSFlexGrid1.Width = Me.ScaleWidth
MSFlexGrid1.Height = Me.ScaleHeight
End Sub
Private Sub TriggerCheckbox(iRow As Integer, iCol As Integer)
With MSFlexGrid1
If .TextMatrix(iRow, iCol) = strUnChecked Then
.TextMatrix(iRow, iCol) = strChecked
Else
.TextMatrix(iRow, iCol) = strUnChecked
End If
End With
End Sub
Private Sub MSFlexGrid1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Or KeyAscii = 32 Then 'Enter/Space
With MSFlexGrid1
Call TriggerCheckbox(.Row, .Col)
End With
End If
End Sub
Private Sub MSFlexGrid1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
If Button = 1 Then
With MSFlexGrid1
If .MouseRow <> 0 And .MouseCol <> 0 Then
Call TriggerCheckbox(.MouseRow, .MouseCol)
End If
End With
End If
End Sub