LoginSignup
0
0

More than 5 years have passed since last update.

Form,WPF->UWPで進歩するComboBox

Posted at

進歩するComboBox

WPFでComboBoxに選択した情報を表示する場合には、下記のように、ComboBoxの.Textに、stringを設定する必要があった。





private void OnCheck(object sender, RoutedEventArgs e) {
RadioButton radiobutton = sender as RadioButton;
DevelopSelector.SelectedItem = radiobutton;
DevelopSelector.Text = radiobutton.Content.ToString();
}

SelectedItemで選択しても、自動的にその結果をComboBoxに表示してはくれなかったのだ。

UWP

ところが、UWPでは、.Textがなくなっている。なくなっていてどう表示するのかと思ったら、
DevelopSelector.SelectedItem = radiobutton;
とSelectedItemにItemを設定するだけでよくなったのだ。
これはちょっと楽。微妙に得した気分。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0