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.

Use a ListBox instead of a text control

Use a ListBox instead of a text control - Visual Basic Tutorial

From the course: Visual Basic Essential Training

Use a ListBox instead of a text control

- [Instructor] Before we look at the collection types, in this chapter, I want to talk about one change I've made to the code explorer. It's this item right here. So up until this point when I've been showing items on this screen, I've either used a text box or a text block, and I've had to manage putting text on a line and setting a new line. We've seen that in some of the demos. There are controls in WPF that are optimized for working with collections, and the one I'm looking at in this course is the list box. So it's optimized to work with different kinds of collections that works very well with the list of T. So that's what I'll use for showing the information in this chapter. I named it output list box. Then what I can do in my code is I can put different kinds of data in there. You notice that if I look here, I'm going to my output box and it has an items property. If I hover over that, I see that that is a items collection. Yes, this is a collection. It's very similar to the…

Contents