S Scolioza Member Licensed User Longtime User Feb 9, 2012 #1 Hello everyone. My question is simple how can we find and see index of a view inside a panel. i mean panel.getview(index). How can we find this index?? If you define in designer where can you see the index?? Thank you!
Hello everyone. My question is simple how can we find and see index of a view inside a panel. i mean panel.getview(index). How can we find this index?? If you define in designer where can you see the index?? Thank you!
Erel B4X founder Staff member Licensed User Longtime User Feb 10, 2012 #2 Here: B4X: Sub Activity_Create(FirstTime As Boolean) Activity.LoadLayout("1") Log(PanelIndexOf(Panel1, EditText2)) End Sub Sub PanelIndexOf(p As Panel, v As View) As Int For i = 0 To p.NumberOfViews - 1 If p.GetView(i) = v Then Return i Next Return -1 End Sub Upvote 0
Here: B4X: Sub Activity_Create(FirstTime As Boolean) Activity.LoadLayout("1") Log(PanelIndexOf(Panel1, EditText2)) End Sub Sub PanelIndexOf(p As Panel, v As View) As Int For i = 0 To p.NumberOfViews - 1 If p.GetView(i) = v Then Return i Next Return -1 End Sub