c# - finding listview column index using simple key string -


I have specified a descriptive name in every 4 columns in my ListView: Head, Mouth, Nose, Eyes I use that text How can I access these columns? I would like to find a way to do it beautifully and concise (with #define):

  if (column [muth] == 6) ...    

is not very elegant, but it should work (text in this example I You can also use the list view.)

  String selected itemMammoth column = List view. Selected items [0] .SubItems [listView.Columns.IndexOf (Mouth)]. Text;    

Comments