I want to select an item in a ListView when clicked. I also want to know what I clicked. I am working on winforms with C #. I also want to know how can I click on the entire line?
Just handle the Click event in the list and use the ListView.SelectedItems property to select which items are selected:
Click
ListView.SelectedItems
private void listView1_Click(object sender, EventArgs e) { var firstSelectedItem = listView1.SelectedItems[0]; }
also, if you use xaml for the window, you must add the MouseUp = "listView1_Click" attribute to the ListView tag
Source: https://habr.com/ru/post/888525/More articles:In java, how can I remove the vowels, these are "a", "e", "i", "o" and "u - javaComparing LDAP Attributes - comparisonCaptcha control does not work with URL routing (ASP.NET 4.0 WebForms) - c #how to convert byte array to integer array - javaPython super () - should work, but no? - pythonIs using Application_OnStart in global.asax working with cached pages? - c #File Usage: /// android_res / drawable / url works under eclipse, but not in production - androidSQL CE Deploy - AppHarbor - Unable to load SQL Server Compact native components - sql-server-cedidSelectRowAtIndexPath selecting multiple rows at a time - iosStrange behavior with response_with syntax for a Rails 3 application? - ruby | fooobar.comAll Articles