Hi I am struggling with an idea, how to automatically expand container horizontally depending on how many elements are in it. My scenario:
Requirements:
I want to auto adjust sub containers depending on how many buttons there are on top of each other for ex. My idea was, that I would do "ForAll" function on all child elements of "Sub1", there I would get reference to every button, get its height, and add everything together. so if one button has height of 30px, multiply it by 4, that is 120px and that would the be the height of the container. The moment, one button is hidden dynamically, height of the container would be 30x3 = 90px
Problem is, I have no idea, how to get child elements of a parent. I wanted to do something like:
Screen4.Main.Sub1.Items
I cannot use other lists/collections where I would be storing elements of each section, because that will be a nightmare to handle. I will be storing different sections with different heights. 😞 Please, do you have any other idea, how to get list of children elements dynamically?
that's unfortunate. I wish MS would provide us a way how to get elements within an app starting from screens down to all other elements. thank you
@PeterFridrich there probably isn't a way to do that. You would have to write the expressions factoring in each sub-container and using their Visible property to conditionally define the height.
---
If you like this reply, please give kudos (Thumbs Up). And if this solves your problem, please mark this reply as a solution by selecting Accept as Solution. This makes it easier for others to find answers to similar questions.
Thanks!
Hardit Bhatia
Microsoft Business Applications MVP
Microsoft Certified Trainer MCT