(C++) Select item in ListBox with Button inside ListBox, how to?
Posted: 17 Jun 2017, 11:09
I have ListBox and all items have button with custom control, inspired with UserControlTutorial. I can easily select item and make codebehind actions, but I lost one day without success, how to get IndexOf from button with custom user control, when button is clicked? I mean, when button from item indexed as 4 in ListBox is clicked, it get that index. I looked in to xaml and C# solutions, but I am unable to recreate it with C++ and Noesis. Functions are different in Noesis as from WPF.
I was thinking about add some value to the Button when is created, but ListBox is dynamic, and any item can be deleted and then added in to list what breake correct indexing for Buttons. (if second item is deleted from three, then second button will have index 3, but it have index 2 (from item in ListBox) and if new item is added, there will be two buttons with index 3).
I was thinking about add some value to the Button when is created, but ListBox is dynamic, and any item can be deleted and then added in to list what breake correct indexing for Buttons. (if second item is deleted from three, then second button will have index 3, but it have index 2 (from item in ListBox) and if new item is added, there will be two buttons with index 3).