On Mar 8, 2007, at 2:56 PM, Peter K. Stys wrote:

> I have an array of checkboxes, I want the clicked one to look checked
> (like a radio button group, but I want checkboxes):
>
> Sub Action(index as Integer)
>   dim j as integer
>
>   ' clear all but the index checkbox
>   for j = 0 to 3
>     if (j = index) then
>       self.CheckBox1(j).value = true
>     else
>       self.CheckBox1(j).value = false
>     end if
>   next
>
>   Return
> End Sub
>
> You'd think this would be a no-brainer but it doesn't work because the
> self.CheckBox1(j).value = true/false stmnts fire new Action events in
> the other (jth) checkboxes so everything gets screwed up.

Not to detract from your suggestion of a built in UserAction  
discriminator(which I think might be a useful option), toggling a  
control "array" of checkboxes can be readily done with code like this  
in Action instead of the code above:

  dim j as integer
  If CheckBox1(index).Value = true then
     For j = 0 to 3
       If j <> index then
         CheckBox1(j).Value = false
       End
     Next
   End


Best,

Jack

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to