LucaMs Expert Licensed User Longtime User Sep 21, 2020 #1 B4X: For Each xv As B4XView In pnlFTFs.GetAllViewsRecursive If xv Is B4XFloatTextField Then Dim ftf As B4XFloatTextField = xv ' <--- here "Types do not match" ? EDIT: B4X: For Each xv As Object In pnlFTFs.GetAllViewsRecursive ' <--- As Object If xv Is B4XFloatTextField Then Dim ftf As B4XFloatTextField = xv Now it works and... disturbs other code ? Last edited: Sep 21, 2020
B4X: For Each xv As B4XView In pnlFTFs.GetAllViewsRecursive If xv Is B4XFloatTextField Then Dim ftf As B4XFloatTextField = xv ' <--- here "Types do not match" ? EDIT: B4X: For Each xv As Object In pnlFTFs.GetAllViewsRecursive ' <--- As Object If xv Is B4XFloatTextField Then Dim ftf As B4XFloatTextField = xv Now it works and... disturbs other code ?
Erel B4X founder Staff member Licensed User Longtime User Sep 21, 2020 #2 That code cannot work. This code will work: [B4X] How to get <custom view here> from <CLV or any other container> Upvote 0
That code cannot work. This code will work: [B4X] How to get <custom view here> from <CLV or any other container>
LucaMs Expert Licensed User Longtime User Sep 21, 2020 #3 Erel said: That code cannot work. Click to expand... It (the second) works. NOTE: the panel contains only "ftf" views. Upvote 0
Erel said: That code cannot work. Click to expand... It (the second) works. NOTE: the panel contains only "ftf" views.
Erel B4X founder Staff member Licensed User Longtime User Sep 21, 2020 #4 It will always be false: Code: If xv Is B4XFloatTextField Then Upvote 0
LucaMs Expert Licensed User Longtime User Sep 21, 2020 #5 LucaMs said: It (the second) works. Click to expand... it seemed to work ? Upvote 0
LucaMs Expert Licensed User Longtime User Sep 21, 2020 #6 So it's "slightly better": B4X: For Each xv As B4XView In pnlFTFs.GetAllViewsRecursive If xv.Tag Is B4XFloatTextField Then Dim ftf As B4XFloatTextField = xv.Tag [I am trying to quit smoking; an enormous effort ?] ? Upvote 0
So it's "slightly better": B4X: For Each xv As B4XView In pnlFTFs.GetAllViewsRecursive If xv.Tag Is B4XFloatTextField Then Dim ftf As B4XFloatTextField = xv.Tag [I am trying to quit smoking; an enormous effort ?] ?
DonManfred Expert Licensed User Longtime User Sep 21, 2020 #7 LucaMs said: I am trying to quit smoking Click to expand... Good Luck! Upvote 0
josejad Expert Licensed User Longtime User Sep 21, 2020 #8 LucaMs said: I am trying to quit smoking Click to expand... Just tobacco, right? ;-) Upvote 0