C# Beginners Tutorial - 172 - Project 4 Address Book, Updating Information and Removing People

thenewboston · 28K views · 2011 · 5:33

Open on YouTube

Software practice, open source & careersSoftware (other)tutorialdated

Why Stack Overflow recommends it

Stack Overflow users cite it as the tutorial they were following when their address book code threw ListView index errors or missing SelectedIndexChanged events.

Recommended by 0 people across 0 different months, 2011 to 2013.

What it is

A short beginner C# tutorial from thenewboston's series, part 172, continuing the Address Book WinForms project. It covers updating a selected person's information and removing people from a list and a ListView.

What people said

Cites eatumup · 2011-10 · Stack Overflow · on “YouTube Tutorial Can't select second Item in Listview (Invalid argument)”

I am trying to follow along and complete this address book tutorial on YouTube Address Book Tutorial [this video] But I have ran into a snag that I don't understand. Following along I cannot find the difference in code. So I am thinking it must be a property setting that I am missing. When I test populate the list I can select the first item. But when I select the second item the debugger kicks out an error invalid argument=value of '0' is not valid for 'index' Can someone tell me why this error is thrown? Listening to the video it sounds like the 0 in the code is to tell the list that you can only select one item at a time. Unfortunately I haven't been able to figure out why his code works and m

Cites webby68 · 2012-10 · Stack Overflow · on “Address Book Tutorial”

I have been working with a c# tutorial for beginners to create an address book [this video] . I followed the instructions, and I have encountered two problems. When I select the properties of the Listview box the SelectedIndexChanged [LINK] event is missing. I have restarted and refreshed the program several times. I have wrote directly to the file, and it is still not present. When selecting a contact from the list, the text boxes do not reflect the selection. I suspect that this is related to the absence of the SelectedIndexChanged [LINK] event in the ui. This persisted even when I set SelectedIndexChanged [LINK] event in code. All help would be greatly appreciated. My code is below using Syste

Cites Abraham · 2013-03 · Stack Overflow · on “InvalidArgument=Value of '0' is not valid for 'index'. Parameter name: index”

I have a custom class "Person" with properties such as Name, Email, etc. I have a List called "people", and I have a listView that displays the name of each item in the "people" list. I'm trying to remove the "people" item that the user has selected in the listView, with the following line of code in a button1.Click event: people.RemoveAt(listView1.SelectedItems[0].Index); But it's throwing the error in the title, however, the code right after that removes the name from the listView it works with no problem: listView1.Items.Remove(listView1.SelectedItems[0]); I was following the tutorial videos found here: [this video] Thank you very much.

Cites F1Krazy · 2013-12 · Stack Overflow · on “Why am I getting an ""Object" does not contain a definition for "Index"" error?”

I've looked and looked but I can't seem to find any solution to this problem so I decided I might as well ask. I'm following this tutorial [this video] to help me create an address book in C# using WinForms. I've created the GUI, and the "Person" class that holds it all together, and I can add entries just fine. But when I write the code to switch between them, following what's written in the tutorial, I get this error message: "object" does not contain a definition for "Index" and no extension method "Index" accepting a first argument of type "object" could be found (are you missing a using directive or an assembly reference?) Here is my code for the "SelectedIndexChanged" event. It's slightly d