CNIT155PracticeLab-GettingStartedWithCSharp-SimpleAdder

CNIT155PracticeLab-GettingStartedWithCSharp-SimpleAdder -...

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon
Practice Lab: Getting started with C# CNIT 15500 Fall 2011 Prof. Harriger Due: n/a Optional Description You are going to practice creating a C# project from beginning to end with a focus on learning where the steps will always be the same and where they will change for the specific application being created. NOTE: These instructions were created using Visual C# 2010 Express. If you use a different tool, your screens may look different. Getting started 1. Open Visual Studio. 2. From the File menu, select New Project 3. On the new project dialogue, select an empty project named MyCSharpApp and click OK: © 2011, Alka Harriger Page 1
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Practice Lab: Getting started with C# CNIT 15500 Fall 2011 Prof. Harriger Due: n/a Optional 4. From the Project menu, select Add Reference. 5. On the Add References dialogue, click the .NET tab and select the component names below (you may hold the Ctrl key to make multiple selections and click OK once OR select one, click OK, and repeat for the other two selections): a. System.dll b. System.Drawing.dll c. System.Windows.Forms.dll © 2011, Alka Harriger Page 2
Background image of page 2
Practice Lab: Getting started with C# CNIT 15500 Fall 2011 Prof. Harriger Due: n/a Optional 6. We will be creating Windows applications in this class, but Visual C# Express defaults to Console applications. To change the default, select My CSharpApp Properties from the Project menu: 7. Under Output type, change Console Application to Windows Application: 8. Now you are ready to begin coding your application. The first object for our application is the main form. From the Project menu, select Add New Item. 9. On the Add New Item dialogue, select Code File, name the file frmMain.cs, and click Add: © 2011, Alka Harriger Page 3
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Practice Lab: Getting started with C# CNIT 15500 Fall 2011 Prof. Harriger Due: n/a Optional 10. In order to view line numbers in the code window, do the following: a. Select Options from the Tools menu b. On the Options dialogue, click the Show all settings checkbox at the bottom-left and then select Text Editor -> C# -> General and check Line numbers under the Display group. Click OK. 11. Enter the code shown below © 2011, Alka Harriger Page 4
Background image of page 4
Practice Lab: Getting started with C# CNIT 15500 Fall 2011 Prof. Harriger Due: n/a Optional 12. Now you are ready to design the user interface. From the Project menu, select Add New Item (as shown in step 8). 13. On the Add New Item dialogue, select Code File (as shown in step 9), but name the file frmMain.Designer.cs, and click Add: 14. Enter the code shown below: © 2011, Alka Harriger Page 5
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Practice Lab: Getting started with C# CNIT 15500 Fall 2011 Prof. Harriger Due: n/a Optional 15. Return to frmMain.cs and enter the code below to call InitializeComponent: 16. The structure of your current project should look like the following in Solution Explorer: 17. Save the entire project. You can do this by selecting Save All from the File menu OR clicking the save all icon from the toolbar. This will bring up the Save Project dialogue (if you
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/21/2012 for the course CIT 155 taught by Professor Lutes during the Fall '10 term at Purdue University-West Lafayette.

Page1 / 16

CNIT155PracticeLab-GettingStartedWithCSharp-SimpleAdder -...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online