 Hey everybody, this is Brian. Welcome to the 22nd C-Sharp tutorial. Once again we're going to make a Windows Form application and let's move this down today. We've already learned the button object. So let's just throw a button on there and what we're going to learn next is called the text box. Now you notice how it has these in the tool box here. Sorry, let's back up. It says all Windows Forms. You can collapse these little panes here. So you can get into various things. What we're going to really be discussing first are in the common controls. They're called common controls because they're pretty common to pretty much all Windows applications. Let's actually throw a label on here and let's throw a text box in here too. Today really what we're going to be covering is the text box. Now as you move controls around, you notice how you can click, drag, and select and move them around. You can select others and as you move you see that blue line that just appeared. You notice how it turns pink. That pink means it's aligned. So if you're not sure about your alignment, you're moving this button around, you're like, I really want to hit that text box. You can see how it aligns it. And when in doubt, you can always just select a bunch of controls and then use up here the increased spacing, decrease, you know, remove horizontal, make vertical spacing equal, you know, et cetera, et cetera, et cetera. Just play around with those a little bit. See how you like, now if you try to center vertically, that's what it does. And that's what it does. So vertical horizontal. Pretty simple. I'm just going to move these back up here and let's resize our form a little bit. Now let's actually just tick this button. We're going to copy and paste that on there. Yes, you can copy and paste objects. We're just going to play around a little bit here. Let's just make something really goofy. Oops, if you're wondering why I changed the floor, I got my gaming mouse hooked up. Sorry about that. I'll say set time and get time. Time is, I'm just kind of whipping through here. If you're wondering what a label is, a label is just quite literally a control that displays text. You can do other neat things with a label, but it's beyond the scope of this tutorial. Really what we want to do with this is just display the text time is. Then we've got our text box. And there's a thing called Windows Design Patterns. You notice how it looks much, much better if it's like that. So when you're designing an application try to adhere to the Windows Design Patterns. In other words, don't put a button on top of your text box or put a button above it or something like that. Look at applications you've used and you've loved and try to design them. Don't blatantly rip them off. Copy them. Just design them in a similar pattern. You notice how there's menus, toolbars, there's status bar, things like that. It's called a Windows Design Pattern. Anyways, getting way ahead of myself here. Let's just select time and...or I'm sorry, the form and we'll just say time demo. That's in the text property of form one in case you're wondering. Notice how it changes the title. And we're just going to play around with this form just for a few minutes here. And we're going to say minimize box, false. Maximize box, false. You notice how they disappear here. Now when we...actually let's do the startup position. Make it easy on us. Center screen. Save this. Run it. And there is our beautiful little form. Now you notice that min and max buttons are gone but we can still resize the form. Let's fix that problem real quick here. Scroll up. And what we're looking for here is form border style. Instead of sizable, we want fixed single. And there's other things like fixed dialogue size, bull, etc, etc, kind of play around with these. Like there's fixed 3D, fixed dialogue, etc, etc. I just want fixed single just for the sake of argument here. Now when we run this, notice how you can't resize it anymore. You can still move it around. No min and max button. We change the title. Alright. Now what we want to do is we want to change the properties of this text box. So let's say set text. Or we're set time. Sorry, what we're going to say. Text box 1. Text. Equal. Date time. Now. Two string. We're just getting this system date time and we're setting it into the text box. So when we click set time, it's just going to put the date and time here. And we should probably actually expand this out because it's going to be fairly long. And get time. We're just going to display message box, we're going to say. So text box 1. And let's just set time. And there is the current system date time. And if we press get time, it shows a message box, which is just the contents of the text box itself. I mean this could be anything like, dear kitty please don't bite my feet ouch while I am recording. Yes, the kitten has been under my desk recording my feet the whole tutorial. Dear kitty, please don't bite my feet while I'm recording. So that's how a text box works. I'm sure you've seen these before so we're not going to spend a ton of time on here. Hold on a second, get out of here you little demon. Wow. This cat ignores me until I start recording and then he just loves my feet. Anyways, sorry. Text box you can enter things into it and you can get the contents from it. Pretty simple. Pretty easy. Very complex control, so not a very complex tutorial. Thank you for watching. I hope you found this educational and entertaining.