Where does the program come from? A C # program may start with a statement from a stack of files and eventually become a program running on your computer. Here's how it came about. Each program comes from the source code file you've seen how to edit the program, and how the IDE saves your program to a folder. These files are your programs-you can copy them to a new folder and open them, and everything is still there: forms, resources, code, and everything else you add to your project.
You can think of the IDE as a very handsome editor. It automatically indents you, changes the keyword color, matches parentheses for you, and even suggests the next possible word. But in the end, all the things the IDE does is edit the files that contain your program.
The IDE binds all of the program's files to this solution by creating a solution (. sln) file and a folder that contains the files used by all programs. The solution file contains a list of project files (ending with. csproj), and the project file contains a list of all the files associated with the project. In this book, you only create a single project solution, but with solution browsers it's easy to add other projects to the solution. NETFramework gives you the right tools.
C # is just a language-it can't do everything on its own. So you need the. NET framework here. Remember the Maximize button you removed from the form? When you click the Maximize button on the window, there is a code that tells the window how to maximize itself and occupy the full screen. The code is part of the. NET Framework. button, check box, list ... These are all part of the. NET Framework. Connecting your form to the database is also a block of internal code. It has the tools to draw graphics, read and write files, manage collections, and do a variety of everyday work for programmers.
The tools in the. NET framework are split into namespaces. You've seen those namespaces, right at the top of your code, the "using" lines. There is a namespace called system.windows.forms--your button, check box, where the form is coming from. Whenever you create a form application project, the IDE adds the necessary files to make your project contain a form, and the top of the file has a line of "using System.Windows.Forms".