简体   繁体   中英

C# WPF if ComboBox Equal multiple conditions

This seems like a real simple one, but after some searching i cannot find a simple answer. I have a combobox that i want to execute the same command if it meets any one of several conditions.. like

 if (comboBox.Text == "Value") or (comboBox.Text == "Value2") or (comboBox.Text == "Value3")
  {
   do the same thing for all 3 values
  }

thanks

if ((boxItem8 == "value1") || (boxItem8 == "value2"))

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM