I have several panels on a form. I need to dynamically create a CommandBar (vertical in this case) and place it on a panel. I then need to reposition this panel and resize the one above so that the entire CommandBar is visible. I would like to set the size and location of these panels based on the size of the CommandBar, but the Size property does not reflect the size required to display all the added buttons.
The CommandBar in the attached image has 5 button, but only three are visible. If I knew the size of the CommandBar, I could set the Location of the panel containing the CommandBar and the Height of the panel above it, so that all 5 buttons would be visible.
How can I get the information needed to set the Size and Locations of the two panels as needed to make the dynamically created CommandBar visible.