Problem With the FlowLayoutPanel

A

aagrawal2

I am using the flow Layout panel to display the Group of controls. The
Controls added in the panel are more than what the panel can display.
They are displayed top to bottom one after the another. Now there
should be a way to navigate the controls which are not visible. The
easiest approach is to set the AutoScroll property to true and rest
will be taken care by the framework.

My requirement is to not use the scroll bar instead there should be two
buttons to navigate the controls Up and Down.

The possible solutions:

1. Let the Autoscroll is On and use the ScrollControlIntoView mehod to
scroll to the proper control on Click of the button.
Problem: The method works fine and i am able to scroll the desired
control in the proper manner but there is no way to get rid of the
scroll bar. So, Does anyone knows how can we get rid of the scroll bar
if it is possible. My investigation concludes that its not possible to
get rid of the scroll bar and achieve the same functionality.

2. Let the AutoScroll is OFF and use the SetBounds method on the
controls placed in the flow layout panel to rearrange them so that the
functionality similar to the ScrollIntoView can be achieved.
Problem: It works fine but we need to suspend the flow layout prior to
SetBounds call on the placed controls and then we need to call
ResumeLayout(false) to make it work. False is must otherwise framework
rearranges the control of the flowlayout panel. So, Is it possible to
permanantly set the bounds of controls so that even if the parent
layout event is called it doesnot rearranges the contols.

Please provide your valuable suggestion.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top