Solved

Resize buttons in panel if vertical scroll is necessary

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Prevent call a sub/function several times when data bind to gridview 21 33
get row value in vb.net 4 18
Store results in vb.net 3 24
Data organization issue 7 19
This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
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 …
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

830 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