What is also often done to ignore looks something like this:
if( txtChord.Text.ToLower() == "a" && cbKeys.SelectedIndex == 6 )
But note that in your if two checks are not โequivalentโ because && has a higher precendance than || . Your equivalent:
if( txtChord.Text == "A" || (txtChord.Text == "a" && cbKeys.SelectedIndex == 6))
Unable to replace one check.
source share