From the course: Visual Basic Essential Training
Unlock this course with a free trial
Join today to access over 24,500 courses taught by industry experts.
Get items from the list - Visual Basic Tutorial
From the course: Visual Basic Essential Training
Get items from the list
- [Instructor] Once you have the data in the list of T, then what do we do? We can work with individual items in the list. That's what we're looking at in this video. I'll be working with this new class that I created called BrandColors. And it has a property called ColorNames, which, as you can see here, is filled with seven colors. Let's go take a look at the code in this class, it's called the BrandColors class. There is a constructor in this class and there is a property called ColorNames, which is a type list of string. And there is a ColorCount property that is an integer property. So what happens is when you instantiate BrandColors, that runs the constructor, that create a temporary list of strings. And then this is the code that we saw in another video, how to add insert items into a list. So we're adding two items, inserting an item at position zero, and then adding a range of items. And then once those are loaded into this temporary list of T, then I assign it to the…
Contents
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
(Locked)
Explore the collection classes10m 18s
-
(Locked)
Use a ListBox instead of a text control3m 10s
-
(Locked)
Create new collections6m 30s
-
(Locked)
Initialize a collection2m 23s
-
(Locked)
Add items to a list1m 13s
-
(Locked)
Get items from the list3m 16s
-
(Locked)
Remove items from a list1m 15s
-
(Locked)
Iterate over a list5m 20s
-
(Locked)
Bind a list to a user control5m 46s
-
(Locked)
Delegates and lambda expressions4m 36s
-
(Locked)
Customize a method with predicate functions5m 21s
-
(Locked)
Quick look at other collection classes4m 28s
-
(Locked)
-
-
-