Question Function to forcibly select listbox items?

patrick

Well-known member
Joined
Dec 5, 2021
Messages
305
Programming Experience
1-3
Hello

ListBox.... ListBox --> Function to forcibly select listbox items in C# source code

In ListView, there is function ===> Item_Index : ListView.Items[index].Selected = true;

In ListBox, =====> Item_Index : ListBox.Items[ 1 ].Selected = true; OR Item_Value : ListBox.Items[ "Apple" ].Selected = true;

An error occurs.
 
What error are you getting?
 
You need to understand that almost all of the WinForms controls are just (often thin) wrappers around an underlying Win32 API control. The Win32 ListBox comes from old Windows 1.0. The Common Control ListView was created by my friend John Kallen along with Chris Guzak for Windows 95. Different generation of controls with different design philosophies and objectives.
 

Latest posts

Back
Top Bottom