• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 441
  • Last Modified:

Resize buttons in panel if vertical scroll is necessary

Hi,
I use a panel control with buttons I add at runtime as the 'main menu' navigation.  Depending on the user, only 3 buttons (no scroll) or 17 buttons (need scroll) appear.  So when there is 17 buttons, the panel adds the vertical scroll.  But the buttons do not resize so then a horizontal scroll also is added.  What I need it to do when the vertical scroll is added that the buttons resize so only a vertical scroll is present. I have tried both docking and anchoring; do I need to use another control...any help would be greatly appreciated.
Please let me know if more information is needed.  Thanks in advance!
0
chilekitty
Asked:
chilekitty
1 Solution
 
Bob LearnedCommented:
I would think that you just need to calculate the width for each button, based on the client width for the Panel and the number of buttons.
0
 
chilekittyAuthor Commented:
Thanks TheLearnedOne...your way is the way I  ended up doing it.  I was hoping that the panel would resize the butons once it would know that it required a vertical scroll.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now