I have a RadioButton and a TextBox inside one StackPanel as shown below:
<StackPanel Orientation="Horizontal">
<RadioButton x:Name="rbSelectedQuantity" GroupName="CardQuantity"
FontSize="14" Margin="5"
Content="Selected Quantity">
</RadioButton>
<TextBox x:Name="txtSelectedQuantity" Width="50" Margin="5" TextAlignment="Right"
Text="0"></TextBox>
</StackPanel>
Here is My Scenario: If I click inside the TextBox, my Radio Button should be checked automatically.
How should I do this?
Handle the
GotFocusEvent for the TextBox and set theRadioButtonIsCheckedproperty toTrue