Mashiane Expert Licensed User Longtime User Jul 26, 2016 #1 Hi there How can I return a custom view instance, as an example, in the CustomListView example I want to get the customlistview instance and assign it to some variable of same type. 1. Let's assume you have 3 customlistviews in your layout. 2. In each customlistview you load different layouts, lets assume one has a button that you can click 3. How do you, from the clicked button get the customlistview instance that houses the button? Currently from the customlistview you can can an index from the sender view, then the panel using that index, how can you get the instance of the listview and assign it to a variable of similar type? Thanks
Hi there How can I return a custom view instance, as an example, in the CustomListView example I want to get the customlistview instance and assign it to some variable of same type. 1. Let's assume you have 3 customlistviews in your layout. 2. In each customlistview you load different layouts, lets assume one has a button that you can click 3. How do you, from the clicked button get the customlistview instance that houses the button? Currently from the customlistview you can can an index from the sender view, then the panel using that index, how can you get the instance of the listview and assign it to a variable of similar type? Thanks
Erel B4X founder Staff member Licensed User Longtime User Jul 26, 2016 #2 It depends on the specific event. For a button click, the simplest way is to store a reference to the CLV in the button's tag property. You can then get it back with: Code: Dim b As Button = Sender Dim clv As CustomListView = b.Tag Upvote 0
It depends on the specific event. For a button click, the simplest way is to store a reference to the CLV in the button's tag property. You can then get it back with: Code: Dim b As Button = Sender Dim clv As CustomListView = b.Tag
Mashiane Expert Licensed User Longtime User Jul 26, 2016 #3 Erel said: It depends on the specific event. For a button click, the simplest way is to store a reference to the CLV in the button's tag property. You can then get it back with: Code: Dim b As Button = Sender Dim clv As CustomListView = b.Tag Click to expand... let me try this out, thanks Upvote 0
Erel said: It depends on the specific event. For a button click, the simplest way is to store a reference to the CLV in the button's tag property. You can then get it back with: Code: Dim b As Button = Sender Dim clv As CustomListView = b.Tag Click to expand... let me try this out, thanks