Problem with FlowLayoutPanel

Answered Closed
0
0

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 <meta name=”viewport” content=”width=device-width, initial-scale=1″>

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

Please advice.

Thank you, Adrian

  • You must to post comments
Best Answer
1
0

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

  • Adrian Zagar
    Thank you Frank, it’s perfect now!
  • You must to post comments
0
0

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.

  • Frank (ITG)
    Hi Adrian, please send the link to supportATwisej.com and we’ll take a look. TIA, Frank
  • You must to post comments
0
0

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

  • You must to post comments
0
0

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

  • You must to post comments
0
0

Hi Adrian,

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

Best regards
Frank

  • You must to post comments
0
0

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!

Attachment
  • You must to post comments
0
0

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

 

  • You must to post comments
Showing 7 results