Yes I am able to access my variables declared in Main as follows:
Main.tMyP.NumPlayersPerRound
No issue in that.
But like i mentioned in my original question I have programatically created around 15 CheckBoxes based on variables defined in my Type data type (MyParameters).
Eeach checkbox represent a variable in MyParameters type.
While adding them to my view programatically i placed the variable name in CheckBox.Tag. Now when the users checks it or un-checks it i want to set the related paramenter variable accordingly.
Currently the only solution that I have is using a Select Case...End Select and set it manually in each case of View's tag value.
So my question is that is there any way in reflector Lib or any other Lib where I can use the variable name as set in view's tag.
Hope I am able to explain my scenario better, this time around.
Here is a sample code of what I am trying to do
' Code in Main Activity
Type MyParameters(AutoMoveToNextHole as Boolean, PlaySound as Boolean, UsePhoneContacts as Boolean, _
SendScoreCardViaEmail as Boolean, SendScoreCardViaSMS as Boolean, SendScoreCardViaWhatsapp as Boolean)
Dim tMyP as MyParameters
tMyP.AutoMoveToNextHole=False
tMyP.PlaySound=True
tMyP.UsePhoneContacts=True
tMyP.SendScoreCardViaEmail=True
tMyP.SendScoreCardViaSMS=False
tMyP.SendScoreCardViaWhatsapp=True
In any other activity I am able to use and set these variables
'in any other activity
If Main.tMyP.AutoMoveToNextHole=False Then
GoToNextHole
End if
Main.tMyP.PlaySound=False
.
.
.
and so on...
Now in my actSettings I have following code:
Sub CreateChkBox(VariableName as String)
dim chk as CheckBox
chk.Initialize("chkbox")
chk.Tag= VariableName ' e.g., VariableName=AutoMoveToNextHole, PlaySound ... etc
.
.
.
End Sub
Now the issue is in checkbox_CheckedChange
Sub chkbox_CheckedChange(Checked As Boolean)
' this is where i need HELP
Dim chk as CheckBox
chk=Sender
' what can i do do set the var value
Main.tMyP.chk.Tag=False ' <---- Need hlep in this line
End Sub