WPF FTP interface

I am creating a program using WPF with FTP interface with two lists and two buttons in between. The problem is I don't know how to set 2 list views to fill the available space without getting buttons to do so.

0


a source to share


3 answers


You can use Grid for this:

<Grid>
    <Grid.ColumnDefinitions>
        <ColumnDefinition Width="*" />
        <ColumnDefinition Width="Auto" />
        <ColumnDefinition Width="*" />
    </Grid.ColumnDefinitions>
    <ListBox
        x:Name="list1"
        Grid.Column="0"
        />
    <StackPanel
        x:Name="buttonsPlaceholder"
        Grid.Column="1"
        />
    <ListBox
        x:Name="list2"
        Grid.Column="2"
        />
</Grid>

      



Also, I find that using absolute sizing is very bad practice because WPF has so many features for auto sizing.

+1


a source


If I don't understand your question, all you have to do is hardcode the buttons widths I guess?



0


a source


Since you are using WPF your interface is in XAML. Why not just change your XAML in Expression Blend and use your mouse to move and size everything how you want it to look.

0


a source







All Articles