When you work with Visual C# 2010 Express, you're going to be working with a set of organizational functionalities called Solutions and Projects. And so what I'm going to do is open Visual C# 2010 Express here and I'm just going to create a New Project. So I'll click on New Project, we'll take all the defaults, Windows Forms Application, Visual C# is our only choice here. And I'm just going to leave the name that I could change right here as Windows Forms Application 1 and then I'll click on OK. Now notice this set up for me over here, a Solution and a Project and notice it's mentioning right here, that I have 1 project in my Solution. Now this gives you a hint that I can have multiple projects and in this first project here, Windows Forms Application 1, it gave me my first form and then I can go out and enter the Toolbox here, and just double-click on Button and I can drop a button onto that form. And then if I double-click that and jump to the Code Behind, you will notice that I'm working in Namespace, Windows Form Application 1, same as my project. Now I can also right-click, I'll left-click on Solution first and then I'll right-click and I can add a New Project to this solution and notice it's warning me here, the current project must be saved, before adding a new one. So okay, I'll take that, notice I'll name it Windows Forms Application 1. I could change it here if I wanted to, notice I can also change the name of my Solution name here if I would like, and notice this right here, Create a Directory for a Solution. It's generally better to leave that checked in most cases and I'll show you why in just a moment. So anyway, we'll click Save here, that saves the Windows Forms Application 1. It gives me the chance now to create the Forms Application 2 and I'll click OK here and notice it creates another Windows Form Application. Now I'm going to go again into Toolbox, double-click Button and drop a button onto this form. And notice if I double-click this one, I am now in Namespace Windows Forms Application 2 as you can see right here. So one of the things that'll I have to watch between moving between these forms, I can come back up and go into this form and notice I'm back in Application 1 now. Okay. So you'd have to watch for this but it's very easy to work with multiple projects in a single solution. Now one other thing I want to show you here, is each of these projects, notice I can expand and collapse these at will and I can see for example, properties on my various aspects of my project. I don't want to go too deep here, references to this project. Notice these are the Namespaces that have references to right now, System, System Core, System Data. So if I want to use another Microsoft Namespace, I just right-click Reference, Add a Reference and I come out into .NET and then you can see the various System.Directories Service. System.Drawing, those sorts of things. And I can even set references to other projects. Okay. So I can work with that and anyway, all these are out there, and you can do this collapsing thing and you can get to all these sort of things within each particular project. Now one other thing I want to show you, before I leave you here, is right-click on Solution and go to Properties and you can see, that I can set Dependencies. I can set all kinds of information, notice the single start up project, which project do I want to start up in this Solution? So I can choose which one is the start up application or the start up project in the Solution. Then I can go to each individual project and right-click and I can go to Properties, and I can work with various properties. Notice Application, my Assembly Name, the Output Type here, let me move this over, so you can see it all. Whether it's a Windows Application, a Console or a Class Library and then notice I can do all kinds of things, Builds, Build Events, Debug, Resources, all kinds of settings. Reference Path Signings, Security. So anything you need to do, you can get out here at the Properties level, on the individual projects as well. So anyway, I just wanted you to see these. Now the last thing I want to show you here is, once I've created these projects and I'm done with them, notice I can close these Tabs out at up here. But if I come down to, in Windows 7, I have the Libraries Folder here but if I go into this and go into Documents now, you will see that there is a Visual Studio 2010 out here. So if I double-click that and go into Projects, you will see, there is my Windows Forms Application. And you remember the little checkbox back there a few minutes ago, where it said, you know, do you want to save this in it's own directory? If I go inside there, there is my Solution file, notice Microsoft Studio Solution and then this is the collection of all the individual files within the project. For example, if I want to see my code, I can just right-click this and I can even open it with something like Notepad, and I can get a glance at my code inside there. Okay. So lots of ways to manage this and work with it. I hope this will help you understand where are all your files are going. What's in there, how to move around, how to adjust things if you need to.
| Course: | Microsoft C# 2010 |
| Author: | Mark Long |
| SKU: | 34306 |
| ISBN: | 978-1-61866-037-4 |
| Release Date: | 2012-03-19 |
| Duration: | 8.5 hrs / 105 lessons |
| Work Files: |
Yes |
| Captions: | No |
| Compatibility: |
Vista/XP/2000, OS X, Linux QuickTime 7, Flash 8 |