<StackPanel Name="stTeam2" Width="40" >
<Button Click="Team2_Click" Height="55" Name="btn1T2" Width="30">T1</Button>
<Button Click="Team2_Click" Height="55" Name="btn2T2" Width="30">T2</Button>
<Button Click="Team2_Click" Height="55" Name="btn3T2" Width="30">T3</Button>
<Button Click="Team2_Click" Height="55" Name="btn4T2" Width="30">T4</Button>
<Button Click="Team2_Click" Height="55" Name="btn5T2" Width="30">T5</Button>
<Button Click="Team2_Click" Height="55" Name="btn6T2" Width="30">T6</Button>
<Button Click="Team2_Click" Height="55" Name="btn7T2" Width="30">T7</Button>
</StackPanel>
Is it possible to find the Button control Based on content.
If T5 is specified can we find the control btn5T2 in the stackpanel?
Yes you can…Although entirely inefficient way to develop WPF software.
Since you gave your StackPanel a name in the XAML you can access it from the Code-Behind
Code Behind