Hi Every Body,
I created a function that create checkbox in a tabpage.
Each created checkbox ID is defined like this : plan1_x_y
Those checkbox are organised like this (see join picture).
I need to check each line of checkbox to get a unique 11 bit value. For example:
Checkbox line 1 column 1 (ID = plan1_1_1) = bit10
Checkbox line 1 column 2 (ID = plan1_1_2) = bit9
and so on until last column and this for each lines.
My problem is that I don't know how to get .ID the value of each Checkbox calling by is name.
Is it possible to dynamically create an object name in order to get his ID?
Like this maybe ????
For y = 1 To nb_y
For x = 1 To nb_x
Log (("plan1_"&y&"_"&x).id)
Next
Next
If anyone know it will be helpfull ;-)
Following my sample code to create checkboxes
Pietro
Here sample code to create the checkbox.
CreateCheckboxes(w_plan, "plan1", 222,39)
CreateCheckboxes(w_plan, "plan2", 222,202)
CreateCheckboxes(w_plan, "plan3", 222,367)
Here the chekbox create function
Sub CreateCheckboxes(Parent As TabPage, nom As String, x_org As Int,y_org As Int) As CheckBox(,)
' screen increment on x
Dim inc_x As Int = 26
Dim inc_y As Int = 19
' coordonnées curseur
Dim le_x As Int = x_org
Dim le_y As Int = y_org
' increment en y
Dim cb(nb_x+1, nb_y+1) As CheckBox
For y = 1 To nb_y
le_y = le_y +inc_y
le_x = x_org
For x = 1 To nb_x
Dim chk As CheckBox
chk.Initialize("chk")
Parent.Content.AddNode(chk, le_x, le_y ,-1,-1)
chk.Text = ""
chk.Id = nom &"_"& y &"_"& y
chk.Checked=True
cb(x, y) = chk
' Log ("Creation of "&chk.Id)
le_x = le_x + inc_x
Next
Next
Return cb
End Sub
I created a function that create checkbox in a tabpage.
Each created checkbox ID is defined like this : plan1_x_y
Those checkbox are organised like this (see join picture).
I need to check each line of checkbox to get a unique 11 bit value. For example:
Checkbox line 1 column 1 (ID = plan1_1_1) = bit10
Checkbox line 1 column 2 (ID = plan1_1_2) = bit9
and so on until last column and this for each lines.
My problem is that I don't know how to get .ID the value of each Checkbox calling by is name.
Is it possible to dynamically create an object name in order to get his ID?
Like this maybe ????
For y = 1 To nb_y
For x = 1 To nb_x
Log (("plan1_"&y&"_"&x).id)
Next
Next
If anyone know it will be helpfull ;-)
Following my sample code to create checkboxes
Pietro
Here sample code to create the checkbox.
CreateCheckboxes(w_plan, "plan1", 222,39)
CreateCheckboxes(w_plan, "plan2", 222,202)
CreateCheckboxes(w_plan, "plan3", 222,367)
Here the chekbox create function
Sub CreateCheckboxes(Parent As TabPage, nom As String, x_org As Int,y_org As Int) As CheckBox(,)
' screen increment on x
Dim inc_x As Int = 26
Dim inc_y As Int = 19
' coordonnées curseur
Dim le_x As Int = x_org
Dim le_y As Int = y_org
' increment en y
Dim cb(nb_x+1, nb_y+1) As CheckBox
For y = 1 To nb_y
le_y = le_y +inc_y
le_x = x_org
For x = 1 To nb_x
Dim chk As CheckBox
chk.Initialize("chk")
Parent.Content.AddNode(chk, le_x, le_y ,-1,-1)
chk.Text = ""
chk.Id = nom &"_"& y &"_"& y
chk.Checked=True
cb(x, y) = chk
' Log ("Creation of "&chk.Id)
le_x = le_x + inc_x
Next
Next
Return cb
End Sub