Professional Documents
Culture Documents
to Programming with C#
Introduction to
Programming and
Visual C# 2008
McGraw-Hill © 2010 The McGraw-Hill Companies, Inc. All rights reserved. 1-2
McGraw-Hill © 2010 The McGraw-Hill Companies, Inc. All rights reserved. 1-3
McGraw-Hill © 2010 The McGraw-Hill Companies, Inc. All rights reserved. 1-4
McGraw-Hill © 2010 The McGraw-Hill Companies, Inc. All rights reserved. 1-5
McGraw-Hill © 2010 The McGraw-Hill Companies, Inc. All rights reserved. 1-6
McGraw-Hill © 2010 The McGraw-Hill Companies, Inc. All rights reserved. 1-7
Object.Property
◦ SalesForm.Text
Object.Method
◦ BillingForm.Show()
◦ exitButton.Show()
McGraw-Hill © 2010 The McGraw-Hill Companies, Inc. All rights reserved. 1-8
Class = automobile
Object = one individual automobile
◦ Object is an instance of the automobile class
Properties = make, model, color, engine,
number of doors
Methods = start, speedup, slowdown, stop
Events = arrive, crash
McGraw-Hill © 2010 The McGraw-Hill Companies, Inc. All rights reserved. 1-9
Solution file
◦ A C# application is called a solution and can
consist of one or more projects
◦ .sln extension
Project file
◦ Describes project and lists files included
◦ .csproj extension
Form files
◦ .cs, .Designer.cs, .resx extensions
The Visual Studio environment creates
several more files
McGraw-Hill © 2010 The McGraw-Hill Companies, Inc. All rights reserved. 1-11
McGraw-Hill © 2010 The McGraw-Hill Companies, Inc. All rights reserved. 1-12
McGraw-Hill © 2010 The McGraw-Hill Companies, Inc. All rights reserved. 1-13
1-13
McGraw-Hill © 2010 The McGraw-Hill Companies, Inc. All rights reserved. 1-15
Integrated
Development Environment (IDE)
McGraw-Hill © 2010 The McGraw-Hill Companies, Inc. All rights reserved. 1-16
McGraw-Hill © 2010 The McGraw-Hill Companies, Inc. All rights reserved. 1-17
Select Visual C#
Windows
McGraw-Hill © 2010 The McGraw-Hill Companies, Inc. All rights reserved. 1-18
Solution
Toolbox Explorer
Properties
window
Main
Document
window
McGraw-Hill © 2010 The McGraw-Hill Companies, Inc. All rights reserved. 1-19
McGraw-Hill © 2010 The McGraw-Hill Companies, Inc. All rights reserved. 1-20
McGraw-Hill © 2010 The McGraw-Hill Companies, Inc. All rights reserved. 1-21
McGraw-Hill © 2010 The McGraw-Hill Companies, Inc. All rights reserved. 1-22
McGraw-Hill © 2010 The McGraw-Hill Companies, Inc. All rights reserved. 1-23
McGraw-Hill © 2010 The McGraw-Hill Companies, Inc. All rights reserved. 1-24
Filter
McGraw-Hill © 2010 The McGraw-Hill Companies, Inc. All rights reserved. 1-25
Design Time
◦ Design user interface (forms)
◦ Write code
Run Time
◦ Testing project
◦ Running project
Debug Time
◦ Run-time errors
◦ Pause program execution
McGraw-Hill © 2010 The McGraw-Hill Companies, Inc. All rights reserved. 1-26