Hi : ))
i have a problem with tag and sender !
in my app create 8 label in loOp and set text and tag of labels = Count LoOp
(and create 1 edittext and 1 button for edit the text of label)
when click of the label with use of sender i have get tag clicked label and equals with edittext text !
i edit the text in edittext
i want when click on button the new edited text is equal to clicked label
this is my code :
and attached project!
i have a problem with tag and sender !
in my app create 8 label in loOp and set text and tag of labels = Count LoOp
(and create 1 edittext and 1 button for edit the text of label)
when click of the label with use of sender i have get tag clicked label and equals with edittext text !
i edit the text in edittext
i want when click on button the new edited text is equal to clicked label
this is my code :
and attached project!
B4X:
Sub Process_Globals
End Sub
Sub Globals
Dim Element_Top As String
Dim Edt_Edit As EditText
Dim Btn_Edit As Button
Dim lbl_Test As Label
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.Color = Colors.LightGray
Create_Btn_Edt
Element_Top = 2%y
For i = 0 To 7
lbl_Test.Initialize("lbl_Test")
lbl_Test.Color = Colors.DarkGray
lbl_Test.TextColor = Colors.White
lbl_Test.Gravity = Gravity.CENTER
lbl_Test.Text = i
lbl_Test.tag = i
Activity.AddView(lbl_Test,2%x,Element_Top,96%x,7%y)
Element_Top = Element_Top + 9%y
Next
End Sub
Sub lbl_Test_Click
' When Click On label Created With LoOp Then --> ( The Text OF Edit Text = lbl Created On lOop Text )
Dim lbl_Tag As Label
lbl_Tag = Sender
Edt_Edit.Text = lbl_Tag.Tag
End Sub
Sub Btn_Edit_Click
'When Click On The This Button Then --> ( Label_Clicked_On_LoOp = New Value(Editedt Text Of Edit Text) )
End Sub
Sub Create_Btn_Edt
Edt_Edit.Initialize("Edt_Edit")
Edt_Edit.Gravity = Gravity.CENTER
Edt_Edit.TextColor = Colors.Black
Activity.Addview(Edt_Edit,1%x,80%y,74%x,10%y)
Btn_Edit.Initialize("Btn_Edit")
Btn_Edit.Color = Colors.Gray
Btn_Edit.Text = "OK"
Btn_Edit.Gravity = Gravity.CENTER
Activity.AddView(Btn_Edit,76%x,80%y,23%x,10%y)
End Sub