In the XAML I have this code:
<ComboBox x:Name="CurrencyCB" Header="Coin Face" FontSize="18" Height="70" Width="296" Margin="5,25,0,0" SelectionChanged="CurrencyCB_SelectionChanged"><ComboBoxItem><x:String> Entry1</x:String></ComboBoxItem><ComboBoxItem><x:String> Entry2</x:String></ComboBoxItem></ComboBox>
In the C# I have this code:
private void CurrencyCB_SelectionChanged(object sender, SelectionChangedEventArgs e) { Choice = CurrencyCB.SelectedValue.ToString(); }
Then calling it in this code:
private void btn_random_Click(object sender, RoutedEventArgs e) { txt_response.Text = Choice; }Just for reference, Choice is a String.