Visual C# Express - Using the Solution Explorer
Microsoft .NET Framework, ASP.NET, Visual C# (CSharp, C Sharp, C-Sharp) Developer Training, Visual Studio
| Visual C# Express: Using the Solution Explorer |
The Solution Explorer window shows which files make up the project you are working with and allows you to open any of them by double-clicking on the item. A single solution and its projects appear in a hierarchical display, similar in nature to windows explorer, allowing you to open and close each node of the project by use of the '+' and '-' signs.
The Solution Explorer supports a variety of management commands (item dependant). For any specified item, the project type determines which management commands are available. For example, if you select a file in a Project, you can use the Delete command to delete the file permanently. To access the management commands, select an item in the Solution Explorer and right-click on it. If you right-click on a '.cs' file (not a form or a control), you get a menu containing nine items.
Open - This opens the selected file within the C# Express IDE on a new tabbed window or if it is already open, then it sets the window as the top-most window.
Open With... - This allows you to choose which application you wish to open the file with. You can also setup the default editor for the file type.
View Code - This opens the code within the C# Express IDE on a new tabbed window or if it is already open, then it sets the window as the top-most window.
Exclude From Project - This allows you to remove an item from the solution without permanently deleting the file.
Cut - This allows you to remove a file from the project, whilst holding a copy in clipboard. (This can then be pasted into another project).
Copy - This allows you to copy a file into the clipboard memory and paste it either into the same project as a copy, or into a new project.
Delete - This allows you to permanently delete a file from the project. (Caution, the file will be deleted from the project folder as well).
Rename - This allows you to rename a file and all of the references to it within the project.
Properties - This allows you to edit the properties of the file.
If you right-click on a '.cs' file that is a form or a control, you get the previous nine menu items plus one more:
View Designer - This opens the Forms Designer window on a new tabbed window or if it is already open, then it sets the window as the top-most window.
You can tell the difference between a '.cs' file that is just a class and one that is a form or control by looking at the icon associated with the file. It is also a good idea to have a good naming convention so that you can tell what are forms or controls at a glance.
Each of the other elements of the solution allow you to do similar functionality. For example if you right-click on the Properties folder, you can simply open it.
When you have more than one project contained within a solution, then the startup Project Name (the one that will be run when you press F5) will be shown in bold text. If there is only one project in the solution as shown in the next diagram, then the Project Name will be in bold.
The toolbar contains five buttons; Properties, Refresh, Show All File, View Code and View Designer.
Figure 11: Visual C# Express - The Solution Explorer
Summary
- The solution explorer lists all of the files that make up the solution.
- When C# Express is first loaded, the Solution Explorer is empty.
- The Properties button displays the Properties Explorer.
- The Refresh button refreshes the current files.
- The Show All Files button displays all of the files including those in the
binandobjdirectories.
- The View Code button displays the code for the currently selected file. (This is only available to
.csand.resxfiles).
- The View Designer button displays the form of the currently selected file. (This is only available to windows forms and controls).
- The startup project name is shown in bold.
- The namespace assemblies are compiled code that your application can use.
MSDN references
|

