In many forms, it is necessary to choose a value from a predefined set, for example, in the case of a category of news or a supported language. Such a task can be accomplished using the ComboBox
control. It allows you to choose a particular value from a drop-down list. In this recipe, you will learn how to use it and adjust its appearance.
To add a combobox and handle the SelectionChanged
event, perform the following steps:
Place the
ComboBox
control with supported languages on the page and adjust its appearance by modifying the content of theMainPage.xaml
file as follows:<Page (...)> <Grid (...)> <ComboBox SelectedIndex="1" Header="Language" Foreground="RoyalBlue" BorderBrush="RoyalBlue" ...