1 00:00:00,780 --> 00:00:06,660 In this video we'll be setting up a C sharp wind Forum's application already have visual studio open 2 00:00:06,690 --> 00:00:12,390 and to get started what we will do is go ahead create a new project and from the templates we're looking 3 00:00:12,390 --> 00:00:13,440 for wind farms. 4 00:00:13,440 --> 00:00:20,050 I can just search quickly and look for wind farms and then I want to wind farms or Windows farms up 5 00:00:20,300 --> 00:00:21,150 in that framework. 6 00:00:21,150 --> 00:00:23,010 So that's the one we're working with today. 7 00:00:23,070 --> 00:00:31,020 So I select that template next then I give my project a name and this one is going to be my first wind 8 00:00:31,090 --> 00:00:32,910 farms are you know I'm not going to do. 9 00:00:32,910 --> 00:00:37,280 That's simply what I'm going to do is similarly it's a real world application. 10 00:00:37,410 --> 00:00:43,950 So let's say we wanted to build our farms to support a car rental business some went to see car rental 11 00:00:44,030 --> 00:00:44,340 up 12 00:00:48,050 --> 00:00:49,460 so that is our project name. 13 00:00:49,490 --> 00:00:51,910 And then that will be our solution. 14 00:00:51,920 --> 00:00:54,860 Also let me just start by spelling here. 15 00:00:54,980 --> 00:01:02,060 Car rental up and we can leave it at the dominant framework so you can see that you have a few versions 16 00:01:02,060 --> 00:01:07,820 of them not Net framework if you have installed Visual Studio auto the box you probably have up to four 17 00:01:07,820 --> 00:01:10,630 point seventy two or maybe you have four point eight. 18 00:01:10,640 --> 00:01:11,420 Any of those work. 19 00:01:11,440 --> 00:01:15,710 What's that leave buying that four point seven point two when you can put your SO that version also 20 00:01:16,040 --> 00:01:17,600 so that we're on the same page. 21 00:01:17,720 --> 00:01:24,490 And then I can go ahead and click Create when this project is created then you'll see something looking 22 00:01:24,490 --> 00:01:30,460 like this and I call this the canvas it's is the farm up on which we will be putting visual elements 23 00:01:30,490 --> 00:01:35,800 but before we get into all of that let's take some time to appreciate the interface and look at the 24 00:01:35,800 --> 00:01:37,600 more important parts. 25 00:01:37,630 --> 00:01:42,900 So if we look at our solution explorer and minus to the left here is might be to the right by default. 26 00:01:42,910 --> 00:01:48,610 Once I have my visual studio set up that minus to the left if you look in there you see your solution 27 00:01:48,840 --> 00:01:55,280 you'll see your project but then your project files really comprise the form one that see us and program 28 00:01:55,300 --> 00:02:02,290 that see us know form one but see this represents this visual representation that you're seeing here. 29 00:02:02,320 --> 00:02:04,330 So this is actually the farm one. 30 00:02:04,330 --> 00:02:10,700 So if I close this by any accident to myself goes a tab if you don't click form one that says that is 31 00:02:10,690 --> 00:02:11,740 what is going to get long. 32 00:02:11,770 --> 00:02:13,050 So this is your farm. 33 00:02:13,210 --> 00:02:17,620 Each farm that you're going to add is going to look like this until you start putting things on that 34 00:02:17,620 --> 00:02:20,780 farm next in ports on file is programmed out. 35 00:02:20,830 --> 00:02:27,370 Yes I can just click it so he can see inside and then you see that it looks just like a console program 36 00:02:27,660 --> 00:02:33,640 the console programs come with a static class programmed by default the namespace which is the folder 37 00:02:33,640 --> 00:02:41,560 that it's in and then the static void main except this one doesn't take an arguments but if you're not 38 00:02:41,770 --> 00:02:44,290 familiar with console programming then that's a problem. 39 00:02:44,290 --> 00:02:47,950 The most important thing to note is that you don't want to be editing this file. 40 00:02:47,950 --> 00:02:48,240 All right. 41 00:02:48,250 --> 00:02:53,510 So the program notes yes later on when you know what you're doing you can edit it and usually you be 42 00:02:53,560 --> 00:02:56,980 editing this file this line and beyond. 43 00:02:56,980 --> 00:03:03,220 But the things that are here these functions are initialize us and I'm not going to spend time telling 44 00:03:03,250 --> 00:03:07,180 exactly what they're initializing this mode Please don't comment or delete them. 45 00:03:07,180 --> 00:03:12,860 And then this one is what actually sees what should be launched when the program launches. 46 00:03:12,880 --> 00:03:18,290 So we have form one that's yes you do seeing launch a new instance of farm one. 47 00:03:18,430 --> 00:03:24,160 And when it does that it will launch our farm that we are designing. 48 00:03:24,160 --> 00:03:24,880 All right. 49 00:03:25,030 --> 00:03:29,310 So we're going to perform a quick activity where we're just going to start this application and we haven't 50 00:03:29,310 --> 00:03:37,050 made any changes we just have it here and we're just going to click start and we will see this window 51 00:03:37,060 --> 00:03:37,510 a lot. 52 00:03:37,540 --> 00:03:39,100 So you see this window launch. 53 00:03:39,110 --> 00:03:41,830 And if I hold it up side by side that can of us you see that. 54 00:03:41,860 --> 00:03:43,750 Well the canvas is empty. 55 00:03:43,750 --> 00:03:45,700 My new window is empty. 56 00:03:46,030 --> 00:03:50,550 So that is what wind farms looks like at least out of the box. 57 00:03:50,560 --> 00:03:55,920 No I just want to point out it's a mistake that's I've seen people make over the years and then they 58 00:03:56,160 --> 00:04:01,960 get all they spend time debugging something or trying to solve a problem that they didn't really have. 59 00:04:01,960 --> 00:04:09,340 So it's a common mistake to minimize this window inadvertently and then you're trying to do an operation 60 00:04:09,340 --> 00:04:12,910 and trying to change quality trying to operate some way somehow. 61 00:04:12,910 --> 00:04:16,850 And didn't you think Visual Studio is not working because it's still in debug mode. 62 00:04:16,930 --> 00:04:22,150 So a new trick starts it goes into B book mode you're seeing all these diagnostics and OK maybe I need 63 00:04:22,150 --> 00:04:22,990 to visit a studio. 64 00:04:22,990 --> 00:04:27,840 Those didn't stand out too but then you're trying to you know change the code and it's not changing 65 00:04:27,850 --> 00:04:30,400 I think that music studio is in an error state. 66 00:04:30,400 --> 00:04:34,720 What happens is that as long as you're in Bebo mode you can't make code changes. 67 00:04:34,720 --> 00:04:40,980 So if you're a visual studio looks like this even though the window is not up on the screen then you're 68 00:04:40,990 --> 00:04:47,500 still in debug mode so you need to make sure you press stop or when you close the window. 69 00:04:47,500 --> 00:04:49,160 So I minimize that just though. 70 00:04:49,170 --> 00:04:53,520 But if I close it as an X then it exits debug mode. 71 00:04:53,530 --> 00:04:59,620 So a common mistake is that people forget you know the launch of the tests and then they forget to close 72 00:04:59,620 --> 00:05:03,700 it and then they go back to business today and try to make whatever adjustments they need to make and 73 00:05:03,700 --> 00:05:07,420 they can't and they think that it's an error but they're really still in debug mode. 74 00:05:07,420 --> 00:05:11,740 I'm just pointing that out in case you know when you're going along you. 75 00:05:11,980 --> 00:05:15,280 So that you can be aware of that come on mistake. 76 00:05:15,410 --> 00:05:23,590 Now the next most important part of this wind farms Development sets of features would be the tool box. 77 00:05:23,590 --> 00:05:30,820 So I have my tool box being kind of underpinned or well docked to the side here. 78 00:05:30,820 --> 00:05:38,570 If you don't see a tool box pane then you can always go to view and then you just look for tool box. 79 00:05:38,570 --> 00:05:43,510 All right there's tool box or you can memorize that keyboard shortcuts if you want but the fact is it's 80 00:05:43,510 --> 00:05:48,240 there if you don't see it readily just go to view and click tool box and launch it. 81 00:05:48,250 --> 00:05:52,390 If you close it by accident you go to view click tool box and launch it's art. 82 00:05:52,390 --> 00:05:59,260 So at any point if I have a pin that you don't have you simply need to go to view find that pain and 83 00:05:59,290 --> 00:05:59,830 open it. 84 00:06:00,040 --> 00:06:06,120 So let's start looking at tool box so in tool box you see that there are some categories of controls. 85 00:06:06,250 --> 00:06:10,430 And for our activity today I want us to focus on the common controls. 86 00:06:10,480 --> 00:06:16,270 If you just you know expand come on controls and take a while and look you can pause this video and 87 00:06:16,270 --> 00:06:20,350 just take a while and look through the different controls you can posit right here and do that. 88 00:06:20,470 --> 00:06:21,810 But I'm going to continue. 89 00:06:21,970 --> 00:06:27,730 And the first thing that I would want to do when somebody launches my application is let them know what 90 00:06:27,790 --> 00:06:29,380 application they have launched. 91 00:06:29,380 --> 00:06:35,070 I mean I'm sure they went and click double click the application to launch it but then you still want 92 00:06:35,070 --> 00:06:36,490 a bizarre presentation right. 93 00:06:36,790 --> 00:06:39,090 So I would bring over a label. 94 00:06:39,160 --> 00:06:39,670 All right. 95 00:06:39,730 --> 00:06:44,410 So windfarms development leads to below the interfaces drag and drop. 96 00:06:44,430 --> 00:06:51,370 So I can drag over the label placed it somewhere and for some reason I get this error you might not 97 00:06:51,370 --> 00:06:53,880 see if you do then you just like okay. 98 00:06:53,890 --> 00:06:55,930 But it was still I love it to proceed. 99 00:06:55,930 --> 00:06:58,860 I'm not entirely sure where I get that error but I'll be getting it. 100 00:06:58,900 --> 00:07:06,280 I mean need to check the installation of Visual Studio but pushing pushing on we look at the label here 101 00:07:06,700 --> 00:07:10,150 and then we want to you know we see the label. 102 00:07:10,150 --> 00:07:11,070 It's not ideal. 103 00:07:11,070 --> 00:07:18,770 It says label one that takes this tiny and so on and then your first instinct might be okay. 104 00:07:18,780 --> 00:07:23,600 I need to edit this text make it bigger or change the text that's in it. 105 00:07:23,770 --> 00:07:28,510 And then your second instincts might have you double click and then you double clicked and then you 106 00:07:28,510 --> 00:07:30,920 ended up in the C sharp code file. 107 00:07:30,940 --> 00:07:32,740 So this is what you call the code behind. 108 00:07:32,800 --> 00:07:40,430 So now I want to explain two things to you and I know this is just to help you be careful when you're 109 00:07:40,450 --> 00:07:42,160 doing these activities. 110 00:07:42,160 --> 00:07:47,320 So I'm going to go back to the design and then what I'm going to show you is that when you double click 111 00:07:47,590 --> 00:07:55,960 control a visual element what's what is happening is that it is going to generate a method stub and 112 00:07:55,990 --> 00:07:59,150 it is going to generate in this case a click event. 113 00:07:59,170 --> 00:08:05,990 So a click event means that when I click this label this code is going to fire. 114 00:08:06,040 --> 00:08:11,380 No I don't need any click event on my label really and truly I don't need anything up in when this label 115 00:08:11,380 --> 00:08:12,070 is clicked. 116 00:08:12,070 --> 00:08:16,990 But I'm just pointing that out because when you double click these visual elements all you're doing 117 00:08:16,990 --> 00:08:18,870 is generating method stubs. 118 00:08:18,880 --> 00:08:26,770 So and once again the reason for you having double clicked it's would be to change its properties. 119 00:08:26,770 --> 00:08:31,130 So we want to change the properties we want to change a text that's in there. 120 00:08:31,150 --> 00:08:35,830 I want to change you know that the whatever it is up to we want to change. 121 00:08:35,840 --> 00:08:41,960 So to do that we have to right click it and go to properties because once again when we double click 122 00:08:42,060 --> 00:08:43,810 it will just generate a method. 123 00:08:43,820 --> 00:08:45,370 It will generate some events. 124 00:08:45,620 --> 00:08:47,810 And that's not necessarily what we want. 125 00:08:47,870 --> 00:08:48,240 All right. 126 00:08:48,530 --> 00:08:54,560 So when you right click the element in this case the label and then I go to properties then it will 127 00:08:54,560 --> 00:08:57,560 launch another pin that might be and was there already. 128 00:08:57,560 --> 00:09:04,040 But for you it may not have been visible but it will launch a pin and then this being allows us to change 129 00:09:04,040 --> 00:09:06,970 the properties of this visual element. 130 00:09:06,980 --> 00:09:13,430 Now let me take this time to explain to you that everything in C sharp is across the very visual elements 131 00:09:13,430 --> 00:09:17,440 that you're dragging over in from the tool box they're listed here. 132 00:09:17,450 --> 00:09:23,690 The button is a class but when you drag it over you've instantiated an object of this class. 133 00:09:23,690 --> 00:09:30,590 So in the context of the label labeled as a C sharp class you drag it over you know have an object called 134 00:09:30,650 --> 00:09:39,470 label 1 and this object has properties that can be changed and these properties are all up sedated inside 135 00:09:39,470 --> 00:09:44,480 of the object and by extension the class type art. 136 00:09:44,480 --> 00:09:53,420 So I have this object here on my own forms called label 1 and it's of the type the class type label 137 00:09:53,930 --> 00:09:57,710 and then I'm going to change the properties so I can change the funds. 138 00:09:57,710 --> 00:10:03,510 So I hope you pause the video and look through all the possible properties that could be changed there 139 00:10:03,510 --> 00:10:04,220 are quite a few. 140 00:10:04,220 --> 00:10:06,130 I'm not one to go through every single one. 141 00:10:06,170 --> 00:10:09,940 I just want to focus on the one that is important which is fund. 142 00:10:09,980 --> 00:10:14,030 So I want to change the funds so I expand the funds property. 143 00:10:14,030 --> 00:10:18,360 I see name that will be the type of funds I can change that to maybe. 144 00:10:18,380 --> 00:10:24,080 Well you may have other funds or funds that you don't have but then want to make some changes so you 145 00:10:24,080 --> 00:10:26,630 can style it's how you see fit. 146 00:10:26,630 --> 00:10:32,750 I'm just changing insults so I change a name I change the size and as you can see the changes are being 147 00:10:32,960 --> 00:10:40,310 revealed real time and then I'm going to change the text that's being displayed because I want not to 148 00:10:40,310 --> 00:10:46,790 see a label one but to see something like a car or into a system. 149 00:10:49,430 --> 00:10:50,210 All right. 150 00:10:50,250 --> 00:10:55,140 And then Karen does this thing goes off so I can just pull it back in. 151 00:10:55,140 --> 00:10:58,660 I wanted to be since I like that you can see it's more. 152 00:10:58,700 --> 00:11:05,100 Well it feels on the label container so I'm going to drag it to the center of the forum itself and there 153 00:11:05,100 --> 00:11:08,220 I have my own label Kyra intel system. 154 00:11:08,220 --> 00:11:08,540 All right. 155 00:11:08,850 --> 00:11:13,780 So I took the label and I changed the properties that I wanted. 156 00:11:13,860 --> 00:11:17,420 I know I can see the manifestation of those changes. 157 00:11:17,520 --> 00:11:17,760 All right. 158 00:11:17,760 --> 00:11:22,950 So let's start dragging over some actual form elements and if you have any experience building forms 159 00:11:22,980 --> 00:11:29,070 you know in web applications then it's the same concept you will have a form you have controls that 160 00:11:29,130 --> 00:11:35,730 allow the user to enter information and of course based on the visual element to use you are controlling 161 00:11:35,730 --> 00:11:38,460 the type of information that you're expecting from the user. 162 00:11:38,760 --> 00:11:40,490 And then ultimately we have a submit. 163 00:11:40,500 --> 00:11:47,070 But so far a car rental system will be collecting the customer name the date that the rental is being 164 00:11:47,070 --> 00:11:53,050 made the date it is suppose the car is supposed to be returned and the type of car that is being or 165 00:11:53,050 --> 00:11:59,040 entered and then we'll have a submit but nice and simple but we are using a few form elements and that 166 00:11:59,220 --> 00:12:02,640 along the way we'll see exactly how each one works. 167 00:12:02,640 --> 00:12:04,310 So let's start with the customer names. 168 00:12:04,340 --> 00:12:08,640 So I don't want to drag over the text box for that. 169 00:12:08,670 --> 00:12:14,730 So ICF takes walks and that I think is the most ideal control and there's a little error again but I 170 00:12:14,730 --> 00:12:21,150 think that the text box is the most ideal control to you know collect the customer name the name of 171 00:12:21,150 --> 00:12:23,190 the customer who is in the car. 172 00:12:23,190 --> 00:12:23,490 All right. 173 00:12:23,940 --> 00:12:25,860 No I just drag it over the text box. 174 00:12:25,860 --> 00:12:32,150 I have it on the form but I don't know if if if I come back tomorrow I have my I mean forget why I have 175 00:12:32,160 --> 00:12:37,440 the text box there is somebody else's obligation and I see a random text box they don't know what information 176 00:12:37,440 --> 00:12:39,810 they're expecting from them. 177 00:12:39,810 --> 00:12:44,740 So it is prudent of us to make sure that we have a label above each control. 178 00:12:44,740 --> 00:12:45,460 Right. 179 00:12:45,510 --> 00:12:52,680 So I have that label and I'm going to change the properties so this label is going to see customer name 180 00:12:53,760 --> 00:12:54,790 right. 181 00:12:55,080 --> 00:12:57,870 And then it is led to you know that will you. 182 00:12:57,960 --> 00:13:01,010 This is a visual cue as to what this text box is for right. 183 00:13:01,040 --> 00:13:09,060 So for each control we have a label that is going to kind of signal to the user hey this is information 184 00:13:09,060 --> 00:13:11,230 I'm requiring from you for this country. 185 00:13:11,240 --> 00:13:11,610 All right. 186 00:13:12,000 --> 00:13:18,090 So we have customer name and if you want to change other properties maybe I want the fund to be a bit 187 00:13:18,090 --> 00:13:18,680 bigger. 188 00:13:18,690 --> 00:13:20,610 So I want this to be twelve. 189 00:13:20,610 --> 00:13:21,310 All right. 190 00:13:21,330 --> 00:13:26,760 And then you can see that what of is kind of hedging over the Facebook itself or is it just re positioning 191 00:13:26,830 --> 00:13:29,540 so that everything looks good and uniformed. 192 00:13:29,550 --> 00:13:30,390 All right. 193 00:13:30,390 --> 00:13:37,050 So our customer name and then we have data in these old satchels data nine days old or the dates the 194 00:13:37,140 --> 00:13:42,030 cars being rented and the data is to be returned because I want us to look at the daytime picture. 195 00:13:42,300 --> 00:13:47,160 So I dragged that over and then I put it where I wanted to go. 196 00:13:47,160 --> 00:13:52,950 And this one now will actually give us a call and say I'm just going to expand to so you can see the 197 00:13:52,950 --> 00:13:56,460 full data in there and copy and paste is a beautiful thing. 198 00:13:56,490 --> 00:14:00,130 So I want to call and control is one for the date. 199 00:14:00,180 --> 00:14:05,250 It's bigger entered into one for the data it's being returned so I can just copy and paste I just use 200 00:14:05,250 --> 00:14:08,090 controls so you control V after selecting it. 201 00:14:08,100 --> 00:14:09,060 And there we go. 202 00:14:09,060 --> 00:14:12,800 So we have two and then the label already have this label. 203 00:14:12,900 --> 00:14:18,300 It has the fun size I want instead of dragging a little of a brand new label and going through the properties 204 00:14:18,300 --> 00:14:21,420 every time I'm just going to copy this new book twice. 205 00:14:21,420 --> 00:14:21,680 All right. 206 00:14:21,690 --> 00:14:24,350 So copy and paste and position. 207 00:14:24,360 --> 00:14:25,980 So that's that. 208 00:14:25,980 --> 00:14:27,540 On this one. 209 00:14:27,540 --> 00:14:31,300 And then I can just click the label and change the text. 210 00:14:31,320 --> 00:14:36,000 All right so I'm just helping you along to be efficient in this because it can be time consuming when 211 00:14:36,000 --> 00:14:40,590 you're go into the tool box and dragging over every time changed the properties over time so if you 212 00:14:40,860 --> 00:14:46,110 can just you know get comfortable or realize copying and pasting is not such a bad thing and you just 213 00:14:46,110 --> 00:14:47,250 know what to change. 214 00:14:47,250 --> 00:14:49,290 Then eventually you become a monster. 215 00:14:49,290 --> 00:14:49,590 All right. 216 00:14:49,980 --> 00:14:57,000 So we're changing this to date oriented and I'm changing this one too. 217 00:14:57,070 --> 00:15:02,640 Dates returned so the texts is returned. 218 00:15:02,710 --> 00:15:03,360 All right. 219 00:15:03,430 --> 00:15:10,270 The next thing that we're doing is the list off the type of cars and the one that is being rented so 220 00:15:10,270 --> 00:15:17,160 far that I'm going to use a combo box so that dropdown list is probably what you would use in each GMO. 221 00:15:17,170 --> 00:15:18,340 And that's fine. 222 00:15:18,340 --> 00:15:21,310 In wind farms it's called a combo box. 223 00:15:21,310 --> 00:15:23,290 They don't call it a jump start. 224 00:15:23,560 --> 00:15:26,980 But then you may see other lists because you have the list box. 225 00:15:26,980 --> 00:15:33,670 You also have the list view so well the list box is probably the the more power level until the combo 226 00:15:33,670 --> 00:15:34,210 box does. 227 00:15:34,210 --> 00:15:37,740 This is a drop note and this is just that area with at least in it. 228 00:15:37,780 --> 00:15:43,030 So I'm going to choose the combo box since that's what you're probably more familiar with both as a 229 00:15:43,030 --> 00:15:49,570 programmer or a web programmer and ready to be a user of any application. 230 00:15:49,570 --> 00:15:56,770 So this one looks similar to a text box except you see that this was done I there which suggests that 231 00:15:56,800 --> 00:15:58,600 it can be dropped. 232 00:15:58,600 --> 00:16:04,210 Don't this I'm just going to expand this and I'm going to make sure that all my controls kind of have 233 00:16:04,210 --> 00:16:08,250 the same with so everything looks uniform. 234 00:16:08,320 --> 00:16:08,850 All right. 235 00:16:09,040 --> 00:16:15,100 I'm going to copy one of my existing labels will fit Doan and then change the text. 236 00:16:15,100 --> 00:16:21,110 So this one is type of car all right. 237 00:16:21,120 --> 00:16:24,520 No I skipped this step earlier and just so you know. 238 00:16:24,540 --> 00:16:28,750 So we need to click on the text box here again to see this that the black up here at the top. 239 00:16:28,770 --> 00:16:34,020 So let's say this is a text box it's mode it's single line and you are probably wondering okay how do 240 00:16:34,020 --> 00:16:37,410 I make it longer or how do I make it taller. 241 00:16:37,540 --> 00:16:41,100 Because you know it is going to only adjust the width on the left or right. 242 00:16:41,100 --> 00:16:47,040 So if you click that little black arrow you can make it multi line which then makes it you know if you 243 00:16:47,040 --> 00:16:54,450 wanted to put in a paragraph or a facility at the intra inter off a paragraph amount of text then you 244 00:16:54,450 --> 00:16:55,440 can do one or two lines. 245 00:16:55,440 --> 00:17:00,570 So this will be perfect for like comments or something like that but focused on the AM I don't need 246 00:17:00,750 --> 00:17:07,290 a tall or I don't need a paragraph looking structure I just need a text box from left or right. 247 00:17:07,320 --> 00:17:12,590 So in the same way when we clicked the combo box you see that little black arrow and when we click it 248 00:17:12,670 --> 00:17:16,560 it will it will allow us to see edit items. 249 00:17:16,560 --> 00:17:22,020 So I'm going to click edit items and then I'm going to fill it with the types of cars that I expect 250 00:17:22,140 --> 00:17:25,220 to show up when we select the dropdown box. 251 00:17:25,590 --> 00:17:36,690 So the types of cars could be Honda Toyota and Honda and a very popular car back here my cool was LADA 252 00:17:37,140 --> 00:17:39,370 And we also had the buggy. 253 00:17:39,420 --> 00:17:40,110 All right. 254 00:17:40,150 --> 00:17:46,700 So Honda Toyota Lada and buggy those are the cars that we have in our rental system. 255 00:17:46,860 --> 00:17:52,740 And then to complete this exercise we are going to have a submit button so I go back to my tool box 256 00:17:53,040 --> 00:18:00,840 get my button drag it over whether my error puts it on the screen I can meet this button as big and 257 00:18:00,840 --> 00:18:02,070 bold as I want. 258 00:18:02,070 --> 00:18:03,660 I mean I can resize it. 259 00:18:03,720 --> 00:18:09,660 I can go back to properties and change the funds so I going to change this fund to look just like the 260 00:18:09,660 --> 00:18:11,080 funds at the top. 261 00:18:11,310 --> 00:18:16,530 That's the mature empty scripts capitals and the size of the text is going to be some of that twenty 262 00:18:16,540 --> 00:18:17,200 five. 263 00:18:17,200 --> 00:18:17,710 All right. 264 00:18:18,270 --> 00:18:20,910 And then I don't want to say but the one that's OK. 265 00:18:21,000 --> 00:18:27,530 So I wanted to see submit so this is going to be the submit button. 266 00:18:27,540 --> 00:18:29,820 So let's just take a look at the farm. 267 00:18:29,850 --> 00:18:34,830 We have the customer name with the data into that the dates return and the type of guy. 268 00:18:34,860 --> 00:18:42,890 So let's just click Start which is going to see all the changes compile everything and then load up. 269 00:18:43,260 --> 00:18:43,920 All right. 270 00:18:43,920 --> 00:18:44,760 And here we are. 271 00:18:44,790 --> 00:18:48,430 So we have our current system and I can test it out. 272 00:18:48,480 --> 00:18:49,200 All right. 273 00:18:49,230 --> 00:18:51,280 So I can enter the customer name. 274 00:18:51,390 --> 00:18:58,290 I can use my date picker and select the date that looks really cool I guess I did go with very little 275 00:18:58,290 --> 00:18:58,760 effort. 276 00:18:58,770 --> 00:19:05,460 If you do a program you know that it's not that easy and the type of car the drop zone and I can select 277 00:19:05,500 --> 00:19:09,330 but then you know it is that type of car that's combo box that allows me to type. 278 00:19:09,350 --> 00:19:12,390 It's not time on autocomplete it's just the behavior off it. 279 00:19:12,390 --> 00:19:18,120 It allows me to actually type in a value that might not have been in the list which is not necessarily 280 00:19:18,120 --> 00:19:22,290 ideal because the point of a drop down list is that you don't want. 281 00:19:22,290 --> 00:19:25,080 You want to control the person see selection. 282 00:19:25,120 --> 00:19:30,630 Let's allow them to enter and then anything and then we put the submit button and we see that well even 283 00:19:30,630 --> 00:19:35,710 though it looked good in the design the rendering doesn't look that way right. 284 00:19:35,780 --> 00:19:39,770 Someone's off to modify it maybe the width so that the T doesn't get chopped off. 285 00:19:39,780 --> 00:19:45,530 So I can disclose that and then we go back just the submit. 286 00:19:45,570 --> 00:19:46,520 All right. 287 00:19:46,590 --> 00:19:52,140 And then what I'm going to do with type of car know the combo box and we go back to our property. 288 00:19:52,140 --> 00:19:57,840 So if you lost the properties you can always just right the control freak properties and then what we're 289 00:19:57,840 --> 00:20:00,580 going to do is change the behavior. 290 00:20:00,600 --> 00:20:04,080 So the drop down style has three modes. 291 00:20:04,080 --> 00:20:08,860 It's as simple as when I click simply you notice that it no longer looks like a job. 292 00:20:08,860 --> 00:20:10,590 No no it looks just like that text box. 293 00:20:10,590 --> 00:20:12,120 That's not what we want. 294 00:20:12,150 --> 00:20:21,550 So I'm going to go back and change that all changed to the other style as soon as I can find it right. 295 00:20:21,680 --> 00:20:25,250 And I'm not finding it because I don't have this I have the farms selected. 296 00:20:25,250 --> 00:20:30,770 So you have to make sure you're selecting the correct control when you're looking over by the properties 297 00:20:30,770 --> 00:20:38,400 are it so simple dropdown and then dropdown list no actually looks more like what I'm expecting a looks 298 00:20:38,400 --> 00:20:44,690 or not it looks on editable from the design and I'm sure that when we run again it will be just that 299 00:20:44,690 --> 00:20:48,320 dropdown list that doesn't allow me to type anything in there. 300 00:20:48,320 --> 00:20:48,670 All right. 301 00:20:48,680 --> 00:20:52,360 So let's just click start again and take a look. 302 00:20:52,370 --> 00:20:52,750 All right. 303 00:20:52,780 --> 00:20:58,400 So this looks a bit better and also submitted showing properly and type of is giving me the list without 304 00:20:58,430 --> 00:21:01,100 allowing me to type anything in there. 305 00:21:01,100 --> 00:21:01,480 All right. 306 00:21:01,700 --> 00:21:07,790 So if I fill out this form and I split my type of car. 307 00:21:07,820 --> 00:21:11,320 And then I click submit my expectations that something is going to happen. 308 00:21:11,330 --> 00:21:16,210 It's going to give me some feedback letting me know that I submitted something. 309 00:21:16,430 --> 00:21:19,300 So that is where events programming comes in. 310 00:21:19,340 --> 00:21:19,520 Right. 311 00:21:19,520 --> 00:21:26,690 So we did discuss earlier that when we inadvertently double clicked the label and by extension do a 312 00:21:26,690 --> 00:21:31,880 double double click any other control it will actually generate a method. 313 00:21:31,880 --> 00:21:34,340 And that's that's not the way I want you to do it. 314 00:21:34,340 --> 00:21:41,900 I wanted to be very are far more deliberate when generating events so that you don't run into problems 315 00:21:41,900 --> 00:21:42,440 later on. 316 00:21:42,430 --> 00:21:50,490 So I want to show you one arrow that might that you can you know prepare for when you have an event 317 00:21:50,510 --> 00:21:54,580 that you didn't necessarily plan for and then you tried to do a cleanup. 318 00:21:54,620 --> 00:21:59,360 You're going to get this arrow and then I want to cut the video here and in the next video we're going 319 00:21:59,360 --> 00:22:04,190 to start looking at how to deliberately create events that actually do stuff. 320 00:22:05,810 --> 00:22:09,200 So when you're in the code behind I call it the code behind. 321 00:22:09,200 --> 00:22:10,800 So let's say we didn't have it. 322 00:22:11,180 --> 00:22:17,270 And I wanted to get to the code file for the form one but yes I can right click on the form right click 323 00:22:17,270 --> 00:22:22,880 pretty much anywhere in the interface here in the design and I will see that option that's his view 324 00:22:22,920 --> 00:22:28,250 quotes if I actually curious if you could do it over there or if I do it on the farm view code is going 325 00:22:28,250 --> 00:22:28,790 to appear. 326 00:22:28,820 --> 00:22:33,270 So when I click view code it brings up that code file nonetheless. 327 00:22:33,380 --> 00:22:37,190 No you don't want to edit much in this file just yet. 328 00:22:37,190 --> 00:22:44,850 As it stands the only thing that's really really important or rather everything here is important. 329 00:22:44,870 --> 00:22:46,300 But this method. 330 00:22:46,340 --> 00:22:52,520 Because once again this is the method stuff that was generated as a click event on the label one. 331 00:22:52,520 --> 00:22:59,390 So that means when I click this this method is going to fire it's empty so clicking it won't have any 332 00:22:59,390 --> 00:23:04,130 effect but then obviously doesn't make sense to have these empty methods. 333 00:23:04,130 --> 00:23:07,430 It makes the code messy and harder to maintain as you go along. 334 00:23:07,430 --> 00:23:12,740 And so I would clean it up so I made it I made the mistake I'm going to clean it up so I delete it. 335 00:23:13,280 --> 00:23:13,690 All right. 336 00:23:13,940 --> 00:23:19,340 Now here is the problem that you might run into when deleting that and if you delete anything make sure 337 00:23:19,340 --> 00:23:25,460 that's all you delete everything else here should stay the same way the public partial class form one 338 00:23:25,460 --> 00:23:31,640 that's the name of the farm on the code file and it is inheriting from a base class called farm. 339 00:23:31,640 --> 00:23:36,530 And then we have a constructor and that is just running this initialized component. 340 00:23:36,560 --> 00:23:43,310 If you don't don't remove this if you remove anything else please don't remove these lines that are 341 00:23:43,310 --> 00:23:44,740 there already. 342 00:23:44,740 --> 00:23:45,200 All right. 343 00:23:45,530 --> 00:23:51,620 So I removed the click event and then I click start and then we're going to get an arrow. 344 00:23:52,730 --> 00:23:53,180 All right. 345 00:23:53,180 --> 00:23:55,010 So it said it was there were build arrows. 346 00:23:55,100 --> 00:23:58,520 Do you want to go to the last successful build to me that doesn't make sense to do. 347 00:23:58,520 --> 00:24:04,370 Because I want to see there I don't want to continue using the program in its previous date someone 348 00:24:04,390 --> 00:24:10,860 to click no and then the error list is going to tell me that it does not contain a definition for something 349 00:24:10,860 --> 00:24:11,640 something something. 350 00:24:11,670 --> 00:24:17,040 So that's a multiple but when I double click it is going to bring me to the era line and what it is 351 00:24:17,040 --> 00:24:19,640 seeing to me now this is the design of dot. 352 00:24:19,690 --> 00:24:20,180 Yes. 353 00:24:20,490 --> 00:24:23,180 So this era line is in a file that we did not write. 354 00:24:23,190 --> 00:24:25,080 We haven't been authoring any code. 355 00:24:25,080 --> 00:24:27,740 All we did was drag and drop what's the engine. 356 00:24:27,750 --> 00:24:32,000 The whole development studio is generating this code for us. 357 00:24:32,010 --> 00:24:36,260 So each control that we've dragged over is represented here in code. 358 00:24:36,270 --> 00:24:37,200 All right. 359 00:24:37,200 --> 00:24:43,380 And then what did it's what you see is that we had created a click event and associated it with label 360 00:24:43,380 --> 00:24:44,180 1. 361 00:24:44,190 --> 00:24:48,300 And so it's looking for that to give in that function. 362 00:24:48,300 --> 00:24:50,460 That's the function I just deleted. 363 00:24:50,490 --> 00:24:54,110 So we all should know by and know that or if you don't that's fine. 364 00:24:54,240 --> 00:24:59,280 Whenever you have a function and you're calling that function if the function does not exist then you're 365 00:24:59,280 --> 00:25:00,180 going to get an error. 366 00:25:00,180 --> 00:25:04,670 So you have to define a function and then you can call a set function. 367 00:25:04,680 --> 00:25:10,890 So we had the function definition it was there we deleted it but we still have the phone song Call into 368 00:25:10,890 --> 00:25:12,280 auto generated code. 369 00:25:12,570 --> 00:25:18,300 So what we can do then is just remove this line because really we don't need to call the function because 370 00:25:18,300 --> 00:25:19,560 we just deleted it. 371 00:25:19,680 --> 00:25:26,370 And then by making that adjustment I can click start again and then I'm in business. 372 00:25:26,400 --> 00:25:32,610 So that's just another thing I wanted to help you through because maybe you would have generated some 373 00:25:32,610 --> 00:25:35,580 click events or some events that you didn't necessarily want to do. 374 00:25:35,620 --> 00:25:37,740 Bad accident and that's fine that's understandable. 375 00:25:37,830 --> 00:25:40,850 But then you remove them and the narrative to arrows. 376 00:25:40,860 --> 00:25:43,250 I'm not sure how to go through the arrows. 377 00:25:43,260 --> 00:25:44,070 That's his whole. 378 00:25:44,480 --> 00:25:50,670 So this is us designing form one in the next video we'll be looking at renaming or controls and the 379 00:25:50,670 --> 00:25:57,750 importance of doing so and how we will actually collect the information that was input into the form.