0

I'm trying to make a simple two-panel file manager (such as Total Commander or FreeCommander). So basically just two listboxes/listviews, one on left, one on right.

But I have hard time trying to make it responsive, when user resizes window either from left side or right side. I need those listboxes to change accordingly on main window/form size, but not cover the other one in process.

I tried on both WPF and WinForms. In WinForms, there is just an Anchor property, which probably can't handle resizing on both up/down and left/right, or I don't know how.

In WPF I know there are tons of ways how to do this, but I don't understand XAML at all, so I'm stuck.

If anyone ever faces similar problem and managed to deal with it, or just has an idea, how to make it work, I would welcome any kind of help.

Ano Nymous
  • 11
  • 4
  • If you're using WinForms, you're looking for the [`TableLayoutPanel`](https://learn.microsoft.com/en-us/dotnet/framework/winforms/controls/walkthrough-arranging-controls-on-windows-forms-using-a-tablelayoutpanel). – 41686d6564 stands w. Palestine Sep 01 '19 at 10:07
  • Possible duplicate of [VB / C#: Resizing two controls equally](https://stackoverflow.com/questions/19074819/vb-c-resizing-two-controls-equally) – 41686d6564 stands w. Palestine Sep 01 '19 at 10:09
  • if you are going to create a WPF application, then learn xaml. it is a "must have" skill. `Grid` with 2 `ColumnDefinitions` fits your requirements. – ASh Sep 01 '19 at 10:31

1 Answers1

0

WPF solution: use a Grid width three columns. One for each ListView and one for the GridSplitter to make both ListView columns resizable.

<Window>
  <Grid>
    <Grid.ColumnDefinitions>
      <ColumnDefinition Width="*" />
      <ColumnDefinition Width="5" />
      <ColumnDefinition Width="*" />
    </Grid.ColumnDefinitions>

    <ListView Grid.Column="0" />
    <GridSplitter Grid.Column="1" Width="5" />
    <ListView Grid.Column="2" />
  </Grid>
</Window>

But I'm afraid this solution won't safe you from learning WPF and especially XAML.

BionicCode
  • 1
  • 4
  • 28
  • 44