tags:

views:

433

answers:

1

Hi I am developing a form for handling access rights in a project. I use VsflexGrid7.0 and also Vb6.0. I thought that it would be good when I show 1 (has access) and 0 (doesn't have) via checkbox within my vsflexgrid(vsflexgrid1).

Now, my problem is when I click on a checkbox for Insert access right, how to get control it's value ?

Thank you

+1  A: 

Just looking at a past project and it seems I added code to initialize and maintain the values myself using the grid's _Click event e.g.

Private Sub Grid1_Click()
  With Grid1
    If .Row > 0 Then  ' omit the header row
      If .Col = 0 Then  ' the checkbox column
        If .TextMatrix(.Row, .Col) = "0" Then
          .TextMatrix(.Row, .Col) = "1"
        Else
          .TextMatrix(.Row, .Col) = "0"
        End If
        DoEvents
      End If
    End If
  End With
End Sub
onedaywhen
First. Thank you.Second, i found that when I click on a column and mark its checkbox surprisingly, it's value is "-1" and when I unmark it, value becomes "0" Third, Why did you use DoEvents in your code? and why at that special line?
odiseh
Well, that's the problem with uncommented legacy code ;) e.g. perhaps the DoEvents line is missing comment, "Paranoid call, attempt to solve unexplained repainting issue"? Sorry I have no further details.
onedaywhen