Solved

Resize buttons in panel if vertical scroll is necessary

Posted on 2009-04-13
2
428 Views
Last Modified: 2012-05-06
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
Comment
Question by:chilekitty
2 Comments
 
LVL 96

Accepted Solution

by:
Bob Learned earned 500 total points
ID: 24137631
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
 

Author Closing Comment

by:chilekitty
ID: 31569677
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
This video discusses moving either the default database or any database to a new volume.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now