[Gambas-user] re-setting several radiobuttons to false ?how

Charlie Reinl Karl.Reinl at ...9...
Wed Aug 5 11:16:32 CEST 2009


Am Mittwoch, den 05.08.2009, 17:48 +1000 schrieb richard terry:
> If one has say 3 radiobuttons in a container
> is there anyway to set them all back to false ?
> 
> If I try this code to clear some textboxes, checkboxes and radiobuttons 
> contained within a hbox, the tetboxes clear and checkboxes clear, but not the 
> radiobuttons:
>  
>   Dim hCtrl As Control
>   Dim hb As HBox
>   Dim tb As TextBox
>   Dim cb As CheckBox
>   Dim rb As RadioButton
> 
>  For Each hctrl In Vbox1.children
>      If hctrl Is hbox Then
>         hb = hctrl
>        For Each hCtrl In HB.Children
>          If hctrl Is textbox Then
>             tb = hctrl
>             tb.Clear()
>          Else If hctrl Is RadioButton Then
>             rb = hctrl 
>             rb.value = False   
>          Else If hctrl Is checkbox Then
>               cb = hctrl
>              cb.value = False  
>         End If
>        Next      
>      End If
>   Next
> 
> If I directly address the radiobutton in the group by name, it still dosn't 
> clear.
> 
> any help appreciated.
> 
> Richard

Salut Richard,

https://secure.wikimedia.org/wikipedia/en/wiki/Radiobutton

The Apple Human Interface Guidelines specify that one item of a radio
button group must always be selected.

Charlie





More information about the User mailing list