Clyde Eisenbeis

Clyde Eisenbeis

  • 1.7k
  • 63
  • 11.5k

How do highlight one ListBox item?

Mar 9 2024 1:16 PM

Using c-sharpcorner.com/UploadFile/mahesh/listbox-in-C-Sharp/ > "C# ListBox Selection Mode and Selecting Items" >

listBox1.SelectionMode = SelectionMode.MultiSimple;  
listBox1.SetSelected(1, true);  
listBox1.SetSelected(2, true);   

Resuts in error messages

'SelectionMode' does not contain a definition for 'MultiSimple'
ListBox' does not contain a definition for 'SetSelected' 

How do I highlight one ListBox item?  See snipboard.io/F2wAt5.jpg.


Answers (2)