lundi 21 août 2017

How to enable button according to the number of checked checkboxes powerbuilder?

I have a datawindow with checkboxes and a button 'OK'. The button is disabled until at least one of the checkboxes is checked. The problem is that if I have more than one checkbox checked and I want to uncheck one the button disables. I wrote the code in itemchanged event:

int li_ind
long    ll_row

choose case dwo.name
    case "ind"
        for row = 1 to this.RowCount()
            if  data ='1' then      
                li_ind++
            end if
        next

        if li_ind <> 0 then
            parent.cb_ok.enabled = true
        else
            parent.cb_ok.enabled = false
        end if

end choose

What am I doing wrong?

Thanks!




Aucun commentaire:

Enregistrer un commentaire