Button sizes become small in a stackpanel

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

i have buttons and i have defined them like this

<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 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 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" />


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



Thank you for posting at Dotnetfunda


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

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.

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