 Hey everybody and welcome to the, wow, 19th cute tutorial with C++. As you can see we've just got our basic GUI application with our dialog box. Today we're going to cover combo boxes. If you have no idea what a combo box is, it should be pretty self-explanatory once you drag and drop one onto a form. Yes, it's that little box where you click it and you get a list of options. We're going to build one of those today. So just drag and drop one on and then let's go into dialog.cpp, UI, combo box. And we're just going to add item. Notice you can add actions. We'll get into that into another tutorial. But you should be familiar with the cute framework and that you can add item, items or actions. So we're just going to add a single item here. And we're just going to say hello. And we'll add another one here. Going to keep this simple just for starters. We'll get a little more complex here in a second. And let's compile and run. And there is the basics of a combo box. It allows you to select an item out of a list of items. All right, now that we've got that out of the way, let's just delete that. And we're going to actually say for, whoops. Oh, while I is less than, we'll say, we'll say nine. I'm just going to do a basic for loop here. And we're going to say UI, combo box, add item. We will say I plus. So we're going to just add a number with the item name. Hey, let's save and run this. And what this does is it gives you a very real sense that well, I'd hope if this actually worked. Hmm, didn't work. Why is that? Well, it didn't work because we are trying to actually add any character value here. You notice how we've got an end, but it's being translated into a care value. How can I tell it's being translated into a care value? Well, when you run this again, you'll notice, as soon as it builds, that you get this weird, you know, why with two dots over it. What in the world's going on there? Well, that's a non printable ASCII character. So what we need to do here is go queue string. Whoops, hope if I could dispel string. And we're going to say number. And then put the I in there. So we're calling the queue string with the static function number and that will successfully convert that integer into a string. That way you're not printing the actual character. See it would print character zero, character one, not the ASCII representation, which is what we want. So that's a common pitfall. I just wanted to be aware of I stumbled across that last night actually. So let's compile and build this. And sure enough, now we magically have a working list. Now, this is great, but how do we tell which item they actually have selected here? Well, let's go into our dialog and let's just add a button here. So we're just going to throw a push button down in here with the epic click me. And we're just going to add a click slot in here. And we're going to just simply say a message box and you know whatever title you want to give it. And for the text, we are going to say UI, combo box one, current text. Very simple. So all you're really saying is current text out of combo box. I could see current text. So let's run this item zero. So if we select another item here, let's say six, item six. And you can also get the index out of here using the, you guessed it, current index. So what good is this really do? Well, combo boxes are a very good way of displaying a lot of data to the user very quickly and letting them choose. Let's say you're running a pet shop and they want to choose between a bird, a cat, or a dog. Or you're running, I don't know, a clothing store. You know what size you want, small, medium, or large. So that is the Q combo box in a nutshell. Very simple control. I realize that the last couple of tutorials have been very easy. We're gradually going to progress into more and more difficult controls. And then we'll get into the non-visual stuff like threadings and timers and things of that nature. This is Brian. I hope you found this video educational and entertaining. And thank you for watching.