Flow Layout Panel issues with Flow set to BottomUp

Answered
0
0

I have my FlowLayout panel set to TopDown. Now the user wants to see the most recent item at the top. So I set the FLP to BottomUp flow.

When I set it to BottomUp – I only see one of my user objects in the panel and a partially cut off user object. So, only on full user object and a partially cut off one – if I have 10 user objects in the FLP – I still only see the same results – one full and one cut off – please see screenshot attached. If I set the FLP back to TopDown – I can see all user objects and it scrolls through them normally.

  • You must to post comments
Best Answer
1
0

You can use a Panel with AutoScroll = true. Add child panels using Dock = DockStyle.Top. See new video and code below.

https://www.screencast.com/t/XUAnWbeS

private void button1_Click(object sender, EventArgs e)
{
var p = new Panel() {
BorderStyle = BorderStyle.Solid,
Text = this.panel1.Controls.Count.ToString(),
ShowHeader = true,
Dock = DockStyle.Top
};
this.panel1.Controls.Add(p);
}

  • You must to post comments
0
0

I don’t think I understood completely. If you only want to scroll vertically you should use a Panel with AutoScroll = true. You can decide if a new panel goes at the top or at the bottom using Controls.SetChildIndex().

The FlowPanel manages the flow layout. BottomUp starts at the lowest left-bottom corners and “stacks” the next control on top until it reaches the top, then it starts another column and restarts from the bottom, and it keeps growing horizontally.

See video:

https://www.screencast.com/t/uEBofkxAN0z

  • edmond girardi
    I am using FlowLayout so I dont have to manage the position of my user object within the panel when I add it. Is there an easier way to use the panel with adding user controls into it (adding my usercontrol at the top above all previous controls added ?
  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.