Button sizes become small in a stackpanel

Posted by Vuyiswamb under WPF on 4/14/2013 | Points: 10 | Views : 1134 | Status : [Member] [MVP] [Administrator] | Replies : 1
Good Day

i have buttons and i have defined them like this



<Grid>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Stretch" Orientation="Horizontal" Height="400">

<k:KinectTileButton Background="{x:Null}" BorderBrush="{x:Null}" Style="{x:Null}" x:Name="btnA" Click="btnA_Click" MinHeight="400" MinWidth="350" Width="198" >

<Image Source="../Images/A.png" />
</k:KinectTileButton>

<k:KinectTileButton Background="{x:Null}" Style="{x:Null}" BorderBrush="{x:Null}" MinHeight="400" MinWidth="350" Width="198" x:Name="btnB" Click="btnB_Click" >

<Image Source="/SchoolPlay1;component/Alphabets101/Images/B.png" />
</k:KinectTileButton>
<k:KinectTileButton Background="{x:Null}" Style="{x:Null}" BorderBrush="{x:Null}" x:Name="btnc" Click="btnC_Click" MinHeight="400" MinWidth="350" Width="198" >

<Image Source="/SchoolPlay1;component/Alphabets101/Images/C.png" />
</k:KinectTileButton>



</StackPanel>
</Grid>

and m gridlayout has the following properties



   <Grid  x:Name="LayoutRoot" MinHeight="768" MinWidth="1024" >


and my Page does not have with and height set as i want to cater for different resolutions.


if i remove the stackPanel , my buttons bring big nicely , but i need then in a Stackpanel kind of control so that they will be aligned in order , but when i have the stack panel in the , the buttons become small, can anyone help regarding this below is the example image

http://social.msdn.microsoft.com/Forums/getfile/271502

Thanks

Thank you for posting at Dotnetfunda
[Administrator]



Responses

Posted by: Jitendrasoft09 on: 4/30/2013 [Member] [MVP] Starter | Points: 25

Up
0
Down
Hi,
This is the issue of stack panel, try to remove or change the property of this code for stack panel -VerticalAlignment="Stretch" , please look into below link that would be helpful for you.
http://stackoverflow.com/questions/932510/how-do-i-space-out-the-child-elements-of-a-stackpanel

Jitendra Kumar
If my post helps you, plz mark as an answer.

Vuyiswamb, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response