Windows Develop Bookmark and Share   
 index > Windows Forms General > List box above list box. How do I get to anchor correctly
 

List box above list box. How do I get to anchor correctly

I have a form that has two horizontal list boxes on it and several buttons, two of the buttons are inbetween the list boxes.

My problem is when I maximise the form at run time the bottom list box runs over the buttons and into the top list box. I have tried all the anchors and have found that I can't get the two boxes to remain the same distance apart. How can I make them work together or how can I anchor the bottom list box to the the bottom corner of the top box so the middle margin stays the same and the boxes expand with the window?

I can get the top box to expand to the correct size and place, but the bottom if anchored to top/right/left/bottom runs over the top and buttons. If it is anchored to the bottom/right/left it remains small and leaves a large margin between the two.

Any ideas, have tride writing code for it but not quiet up to that stage

Kiwi bloke  Tuesday, September 05, 2006 10:25 PM
Try using the TableLayoutPanel class...
nobugz  Tuesday, September 05, 2006 11:16 PM
Try using the TableLayoutPanel class...
nobugz  Tuesday, September 05, 2006 11:16 PM
That worked there are so many features to this program I missed that one. Took a little playing about with percentages (%) but very useful. Thanks
Kiwi bloke  Wednesday, September 06, 2006 4:52 AM

You can use google to search for other answers

Custom Search

More Threads

• GraphicsPath on Transparent Bitmap
• Manual Event Handling
• How to create plot in picturebox?
• Designer won't let me look at two forms
• Closing forms and controls
• Evaluating WinGrid
• How to disable button outline?
• Killing Threads
• Rich Text Box Border Style
• Thumbnail an html page directly from IE programmatically?