Yes!
This is an example from Erel hiding all buttons of an activity:
For i = 0 To Activity.NumberOfViews - 1
If Activity.GetView(i) Is Button Then
Activity.GetView(i).Visible = False
End If
Next
specci48
So using this example how would I modify it for getting or setting the check state for a number of Checkbox views on a panel view?
I have seen threads on how to trigger code for a "Sender" event but what I am trying to do is iterate through all checkbox views on a panel when I call my sub routine to set or get the checked status for persistent data for the pause and resume events on screen rotation.
In designer I have added a number to the views tag property when I iterate through all views of a panel. Below is the code I have at the moment but I am thinking I should not have to use a Select Case statement with direct reference to the checkbox view name. I was hoping to do something like
MyCheckStatus = Activity.GetView(i).Checked
but "checked" is not a property when using GetView(i)
I am having a mind blank! Can anyone help me please?
For i = 0 To pnlCreateWorkout.NumberOfViews -1
If pnlCreateWorkout.GetView(i) Is CheckBox OR EditText Then
Tag = pnlCreateWorkout.GetView(i).Tag
Select Tag
Case 1
'CheckBox All Days
MyPersistantData.cbstate(Tag) =
Case 2
'Checkbox Sunday
Case 3
'Checkbox Monday
Case 4
'Checkbox Tuesday
Case 5
'Checkbox Wednesday
Case 6
'Checkbox Thursday
Case 7
'Checkbox Friday
Case 8
'Checkbox Saturday
Case 9
'EditText Workout Title
Case 10
'Spinner - Difficulty Level Selector
Case 11
'TextEdit Discription
Case 12
'TextEdit All Days Title
Case 13
'TextEdit Sunday Title
Case 14
'TextEdit Monday title
Case 15
'TextEdit Tuesday Title
Case 16
'TextEdit Wednesday Title
Case 17
'TextEdit Thursday Title
Case 18
'TextEdit Friday Title
Case 19
'TextEdit Saturday Title
End Select
End If
Next