Chapter 7: Classes, Constructors, Overloading, and Help

 

Overview

Visual Studio C# code placement in FormX.cs source code is not greatly different from C or C++ code placement, but there are a few changes that should be mentioned. For this exercise, move to the desktop, bring up the IDE, and click on the File main menu item, followed by Open, then Project/Solution. When the Open Project window opens, go to Visual Studio 2005\Projects\DemosSourceCode. Click on the CodePlacement folder, and then click on the CodePlacement.sln file (which is the highlighted file in the folder). This opens the project in the IDE.

Click on the Build item in the main menu, then Build Solution (which compiles the project). After compilation, click on the Debug main menu item and select Start Debugging (which runs the project). This project has two windows ” a main window and a child window. Some of the lines of code in Form1.cs and Form2.cs have been tagged at the left edge of the source code so the instructions in this chapter will lead you directly to a particular line of code. The main window looks like this:

image from book
Figure 6-1: Code Placement, main window

The child window that is created from the main window is shown in Figure 6-2.

image from book
Figure 6-2: Child window

The project is initially set up so the main window and child window can pass information to each other, using lines CP204, CP301, CP401, and CP402. (The source code is listed at the end of this chapter.)

 


Unlocking Microsoft C# V 2.0 Programming Secrets
Unlocking Microsoft C# V 2.0 Programming Secrets (Wordware Applications Library)
ISBN: 1556220979
EAN: 2147483647
Year: 2005
Pages: 129

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net