I'm loading images dynamically inside a FlowLayoutPanel
. I need for this panel to auto-size but only vertically.
Is this possible, and if so, how do I go about achieving it?
Maybe
FlowLayoutPanel1.WrapContents = False;
FlowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.TopDown;
will help you.
Simple, add a event of type control added:
private void flowLayoutPanel1_ControlAdded(object sender, ControlEventArgs e)
{
if (flowLayoutPanel1.Controls.Count % 10 == 0)
flowLayoutPanel1.SetFlowBreak(e.Control as Control, true);
}
set AutoSize = true
set flowdirection = LeftToRight
I did set the Size from panel dinamically. Example:
int newHeight= listImages.Count/10 * 100; flowLayoutPanel1.Size = new Size(1143, newHeight);
It works for me. Thx all
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With