 Hey everybody, this is Brian. Welcome to the 21st C-Sharp tutorial. We're just going to make a Windows form application. And let's open up our toolbar here and make sure that it stays open by panning it. Today we're going to discuss the button. The button doesn't seem like a big, big deal. You've seen a million of these things. You just drag and drop two buttons on here. You've got button one, button two. So when you run this thing, drag the application over here, you see button one, button two. Nothing really happens. So what is a button? Well, as you see, when you click it, something is supposed to happen. You've seen buttons before. So I'm not going to tell you with the internals of how a button works. But what you need to know is the events needed to make this thing work. And really the event you're going to use the most is click. Now there's two ways of doing it. You can either select the click event and then just double click. And it'll generate the code. Unpin the toolbar there. And there's button one click. Just select the button and then double click it. And it puts it in there. Pretty simple. Pretty easy. Not a whole lot to really show you here with the button. I'm just going to do a basic message box. Oops, hello from button one. Help if I put that inside of quotes here. And hello from button two. Now one handy trick I kind of want to show you is the form itself is actually a control. So you've got form one selected and then you've got properties and events. So we can actually just resize this a little bit. You see the form has a whole ton of properties. Something you should kind of explore is this properties window. Whenever you select a control, you notice how it flips over to that control. And then it has the properties. So we're just going to look at form one startup position. See how it says windows default? You can actually say center screen or center parent or something else. So when you run this, it just runs directly in the center of your screen. Now when we click the buttons, hello from button one, hello from button two. Easy to use, easy to clean, easy to load. That's kind of a military term. But anyways, exploring the button object here you can see there's something called text. So you can say click me. And then you have special things like alignment, overlay, things like that. Visible, you can make the button not visible. So like let's go into button one and we'll say button two dot visible equal true. So what are we doing here? I know this seems simple, but let's review. In the properties of button two, we're saying visible equal false right here. So when we click button one, we're saying show hello from button one and then button two visible equal true. So we're going to show that button. Let's go ahead and run this. Notice how button two is invisible. There's nothing there. You can click all you want. It's just not there. You click button one and let's move this. You notice how it's still invisible because we have this message box up. That's called a modular window or a modeler. A modular. Somebody messaged me and let me know. I always get those confused. Basically what it means is while this message box is up, you can't click on anything else. Notice how it's like freaking out. Now when you hit OK, it returns back to the form watch. Notice how suddenly click me is there. Same thing. So pretty simple, pretty quick tutorial. It's really all I wanted to show you was the button object. Thank you for watching. I hope you found this educational and entertaining. Give me some feedback on these. I really want to make the C-Sharp tutorials really polished and really good. As good if not better than my Qt tutorials because well, C-Sharp admittedly is my favorite language. My only regret with using it is that Visual Studio doesn't run in Linux. But don't tell Microsoft that. Thanks for watching.