Skip to content

Problem with FlowLayoutPanel #4645

Closed
Closed

Description

@itg-assistant

Adrian Zagar asked 2024-10-04 07:10:47 UTC

I have a Page with a FlowLayoutPanel p, p.FlowDirection=TopDown. Inside I have a number of comboBox and TextBox controls, all of them with Dock=Fill.

It loock perfect on portrait mode, but very weird on landscape (there is no responsive profile procedure, because I consider the Dock=Fill will do the job).

In default.html I have

I attached 2 screenshots (portrait and landscape) and the Designer.cs file.

Please advice.

Thank you, Adrian

Activity

  1. itg-assistant commented on Jun 16, 2026

    @itg-assistant
    Author

    Paul answered 2024-10-07 20:26:33 UTC

    Hi Adrian
    I hope that my sample code could help you

    Just add code for the Page event ClientSizeChange and check the main page With property

    I also atach the code sample

    Regards

  2. added
    BugSomething is broken or behaving unexpectedly.
    on Jun 16, 2026
  3. itg-assistant commented on Jun 16, 2026

    @itg-assistant
    Author

    Adrian Zagar answered 2024-10-08 07:13:22 UTC

    Hi Paul,

    Thank you for your answer. The situation is quite different. In your scenario, you set the combos and textboxes width and Dock=None, and set fixed size of flowLayoutPanel.

    In my case, I tried that:

    • flowLayoutPanel: Dock=fill (to use all space available in portrait/landscape)

    • All combos and textboxes has Dock=fill (to use all available width of flowLayoutPanel). I presume that flowDirection=TopDown means one control on each "row".

    Trying to add your code on my page resulted in a total mess, especially when returning from landscape to portrait (see attached screenshots). If possible, direct me how to obtain that goal: all controls width=screen width and vertical scroll if necessary, on both portrait and landscape.

    Thank you!

  4. itg-assistant commented on Jun 16, 2026

    @itg-assistant
    Author

    Frank (ITG) answered 2024-10-08 10:31:05 UTC

    Hi Adrian,

    please attach a compilable and runnable test application, then we can take a closer look at it.

    Best regards
    Frank

  5. itg-assistant commented on Jun 16, 2026

    @itg-assistant
    Author

    Adrian Zagar answered 2024-10-08 11:15:45 UTC

    Hi Frank,

    I attached a (very basic) sample project that perfectly reproduce my problem. I also uploaded two screenshots. As you can see, on landscape the last 2 textboxes are (probably) in the upper right corner and the buttons are not shown.

    Thank you,

    Adrian

  6. itg-assistant commented on Jun 16, 2026

    @itg-assistant
    Author

    Frank (ITG) answered 2024-10-08 11:27:24 UTC

    Hi Adrian,

    thanks for the sample. You should remove Dock=Fill from all your child elements and instead anchor them to Top, Left and Right.
    See modified sample.

    Best regards
    Frank

  7. itg-assistant commented on Jun 16, 2026

    @itg-assistant
    Author

    Adrian Zagar answered 2024-10-08 11:47:44 UTC

    Hi Frank,

    You are fast for sure!

    Your modified project (and initially mine with the modification indicated by you) looks the same as the original one (well, maybe the padding is increased a little bit). I can give you a link to the site if you want to test on a mobile. I don't know if I should write the link here, as it is my test server.

  8. itg-assistant commented on Jun 16, 2026

    @itg-assistant
    Author

    Frank (ITG) answered 2024-10-08 11:54:51 UTC

    Hi Adrian, please send the link to supportATwisej.com and we’ll take a look. TIA, Frank

  9. itg-assistant commented on Jun 16, 2026

    @itg-assistant
    Author

    Frank (ITG) answered 2024-10-08 21:05:36 UTC

    Hi Adrian,

    you need to change the WrapContents of your FlowLayoutPanel to false, then it should all work like you'd expected it.

    Best regards
    Frank

  10. itg-assistant commented on Jun 16, 2026

    @itg-assistant
    Author

    Adrian Zagar answered 2024-10-09 06:01:37 UTC

    Thank you Frank, it’s perfect now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething is broken or behaving unexpectedly.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions