Solved

Resize buttons in panel if vertical scroll is necessary

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…
Need to grow your business through quality cloud solutions? With everything required to build a cloud platform and solution, you may feel like the distance between you and the cloud is quite long. Help is here. Spend some time learning about the Con…

919 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

12 Experts available now in Live!

Get 1:1 Help Now