Click here to Skip to main content
16,017,271 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have four user controls inside my main xaml window
what shall i do to make the user controls resizable during runtime ..??
similar to visual studio editor where in we can resize the solution explorer and properties window.
Posted
Comments
Sriram Bala 20-Aug-13 2:03am    
Hi Arun pk.
If you are using the Parent container control as Grid then you have the GridSplitter control as an option to resize and adjust all the four user controls similar to Visual studio editor. Tell us how you placed the usercontrols like all stacked horizontally or vertically mostly i am looking for the layout.
Regards,
Sriram.B
arun_pk 20-Aug-13 2:09am    
Hello Sriram
This is how i had placed the controls.. for eg here i am using four buttons.
I have a grid with 2 columns and 3 rows..

<grid>
<grid.columndefinitions>
<columndefinition width="52*"> <columndefinition width="21*">
<grid.rowdefinitions>
<rowdefinition height=" 52*">
<rowdefinition height="21*">
<rowdefinition height="21*">

<Button Grid.Row="0" Grid.Column="0" Grid.RowSpan="2" Margin="5,5,5,5"></Button>

<Button Grid.Column="1" Grid.Row="0" Grid.RowSpan="2" Margin="5,5,5,5"></Button>
<Button Grid.Column="0" Grid.Row="2" Margin="5,5,5,5"></Button>
<Button Grid.Column="1" Grid.Row="2" Margin="5,5,5,5"></Button>

1 solution

XML
<Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="*"></RowDefinition>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"></ColumnDefinition>
            <ColumnDefinition Width="Auto"></ColumnDefinition>
            <ColumnDefinition Width="*"></ColumnDefinition>
        </Grid.ColumnDefinitions>

        <Button Grid.Row="0" Grid.Column="0"  Margin="5" Height ="25" Width="25"/>
        <GridSplitter Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2"  Height="5" Width="Auto"  HorizontalAlignment="Stretch" Background="Red" ></GridSplitter>

        <Button Grid.Row="0" Grid.Column="2" Margin="5" Height ="25" Width="25"/>
        <GridSplitter Grid.Row="0" Grid.Column="1"  Height="Auto" Width="5"  VerticalAlignment="Stretch" Background="Green" ></GridSplitter>

        <Button Grid.Row="2" Grid.Column="0"  Margin="5" Height ="25" Width="25"/>
        <GridSplitter Grid.Row="2" Grid.Column="1"  Height="Auto" Width="5"  VerticalAlignment="Stretch" Background="Blue" ></GridSplitter>

        <Button Grid.Row="2" Grid.Column="2"  Margin="5" Height ="25" Width="25"/>
        <GridSplitter Grid.Row="1" Grid.Column="2"  Height="Auto" Width="Auto"  HorizontalAlignment="Stretch" Background="DarkOrange" ></GridSplitter>
    </Grid>
 
Share this answer
 
v2
Comments
Punamchand Dhuppad 20-Aug-13 3:28am    
nice one
Sriram Bala 20-Aug-13 4:42am    
Thanks Punam1990

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900