My Grid is looking like this and i want to work in the second column.
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
</Grid>
My code for second column is like this: when i resize my window the column just resize like i haven't set a minWidth in this grid. I want the image to stay visible and the first column(textbox) to resize first.
I want column 1 to stay visible the longest
<StackPanel Grid.Column="1" Margin="5,0,0,0">
<Label Height="16" Style="{StaticResource InputLabel}" Content="Sup" />
<Grid MinWidth="200">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="30" MinWidth="30" />
</Grid.ColumnDefinitions>
<Border Padding="5,2,0,0" Grid.Column="0" BorderThickness="4,0,0,0" Background"{StaticResource LightBackground}" BorderBrush="{StaticResource SupplierColor}">
<TextBlock Background="White" Text="{Binding Name}" />
</Border>
<Button MinWidth="25" Grid.Column="1" Margin="5,0,0,0"
cal:Message.Attach="[Event Click] = [Action Search]">
<Image Source="{StaticResource Search-Tiny}" Width="16" />
</Button>
</Grid>
</StackPanel>
Setting the
MinWidth
in the secondGrid
to 200,somehow sets indirectly theMinWidth
of theBorder
to (200 - 25 = 175), and that what makes the imageButton disappears from the view when re-sizing the window, you will get the expecting result if you don't set theMinWidth
of the second grid, yourXaml
should look like so :