Note that there are some explanatory texts on larger screens.

plurals
  1. POWPF WrapPanel Dynamic Height
    text
    copied!<p>I have a wrap panel that will contain a variable amount of controls.</p> <p>I want the orientation to be vertical (as objects within will have a fixed width but variable height). </p> <p>But the issue I'm having is that when a scrollbar is present the height is inifinite so the items never wrap onto the second column. The scrollbar is necessary as there will frequently be more objects than it's possible to fit on one screen. I can stop this by setting a fixed height, but this isn't an acceptable solution as a reasonable fixed height will differ for each selection.</p> <p>Essentially I'd like a <code>WrapPanel</code> whose height changes dynamically based on the width of the panel and the amount of items contained within.</p> <p>To illustrate:</p> <p>If the panel is wide enough to show 3 columns it will:</p> <p>| 1 5 9 |</p> <p>| 2 6 - |</p> <p>| 3 7 - | Height=4</p> <p>| 4 8 - |</p> <p>But if the user changes the size of the window to the point where it can only accomodate 2 columns the height will increase:</p> <p>| 1 6 |</p> <p>| 2 7 |</p> <p>| 3 8 | Height = 5</p> <p>| 4 9 |</p> <p>| 5 - |</p> <p>Also, I'm not sure how feasible this is but I would ideally like the order the items horizonatally but keep the orientation vertical, so they'd be ordered:</p> <p>| 1 2 3 |</p> <p>| 4 5 6 |</p> <p>| 7 8 9 |</p> <p>Could anyone tell me how to go about getting started with this? I'm assuming it's possible with a custom implementation of the <code>WrapPanel</code>, but I'm slightly confused how to get started.</p> <p>Thanks,</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload