Solved

Resize buttons in panel if vertical scroll is necessary

Posted on 2009-04-13
2
430 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

772 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