oops... forgot to add dockpanel back to the Grid
<Grid Grid.Row="1" DockPanel.Dock="Bottom">
<Grid.ColumnDefinitions> <ColumnDefinition />
<ColumnDefinition /> </Grid.ColumnDefinitions>
<Button Grid.Column="0" Content="Button" Margin="20" Name="button1"
Click="button1_Click" HorizontalAlignment="Stretch" />
<Button Grid.Column="1" Content="Button" Margin="20" Name="button2"
Click="button2_Click" HorizontalAlignment="Stretch" /> </Grid>
On Wed, Mar 2, 2011 at 9:55 AM, Stephen Price <[email protected]>wrote:
> <Grid Grid.Row="1"> <Grid.ColumnDefinitions>
> <ColumnDefinition /> <ColumnDefinition />
> </Grid.ColumnDefinitions> <Button Grid.Column="0" Content="Button"
> Margin="20" Name="button1" Click="button1_Click"
> HorizontalAlignment="Stretch" /> <Button Grid.Column="1"
> Content="Button" Margin="20" Name="button2" Click="button2_Click"
> HorizontalAlignment="Stretch" /> </Grid>
>
>
> Replace you Stackpanel with this and you should get what you were after?
>
>
> On Wed, Mar 2, 2011 at 9:39 AM, Peter Maddin <[email protected]>wrote:
>
>> I am revisiting my UI WPF design.
>>
>>
>>
>> In the snippit below, I was expecting the two buttons to fill the entire
>> space of the StackPanel while observing the margin requirements.
>>
>> However the two buttons are sized to their contents and not stretched.
>>
>>
>>
>> <DockPanel LastChildFill="True">
>>
>> <StackPanel Orientation="Horizontal" DockPanel.Dock="Bottom" >
>>
>> <Button Content="Button" Margin="20" Name="button1"
>> Click="button1_Click" HorizontalAlignment="Stretch" />
>>
>> <Button Content="Button" Margin="20" Name="button2"
>> Click="button2_Click" HorizontalAlignment="Stretch" />
>>
>> </StackPanel>
>>
>> <Grid >
>>
>> <Ellipse Name="ellipse1" Stroke="Black" Margin="50" />
>>
>> </Grid>
>>
>> </DockPanel>
>>
>>
>>
>> This does correlate with what my text WPF 4 unleashed page 104 says.
>>
>> Is there some other factor involved?
>>
>>
>>
>> Sorry that this such a basic question.
>>
>>
>>
>> *Regards Peter Maddin*
>> *Applications Development Officer*
>> *Path**West Laboratory Medicine WA*
>> *Phone : +618 6396 4285
>> Mobile: 0414 240 307*
>> *E-Mail : [email protected]; [email protected]*
>> *The contents of this e-mail transmission outside of the WAGHS network
>> are intended solely for the named recipient's), may be confidential, and may
>> be privileged or otherwise protected from disclosure in the public interest.
>> The use, reproduction, disclosure or distribution of the contents of this
>> e-mail transmission by any person other than the named recipient(s) is
>> prohibited. If you are not a named recipient please notify the sender
>> immediately**.*
>>
>>
>>
>>
>>
>> _______________________________________________
>> ozwpf mailing list
>> [email protected]
>> http://prdlxvm0001.codify.net/mailman/listinfo/ozwpf
>>
>>
>
_______________________________________________
ozwpf mailing list
[email protected]
http://prdlxvm0001.codify.net/mailman/listinfo/ozwpf