SlideShare ist ein Scribd-Unternehmen logo
1 von 59
Programming in Visual C# 2005 Chapter 1 Introduction to Programming and C#
Chapter Objectives  (1 of 2) ,[object Object],[object Object],[object Object],[object Object],[object Object]
Chapter Objectives  (2 of 2) ,[object Object],[object Object],[object Object],[object Object],[object Object]
Creating Windows Applications ,[object Object],[object Object],   Labels    Text Boxes    Buttons    Radio   Buttons    Picture Boxes    Check Boxes    Menus    Drop-Down Lists    List Boxes    Group Boxes Click each element type to see example
Windows Graphical User Interface (GUI) ,[object Object],[object Object],[object Object],[object Object]
Programming Languages—Procedural, Event Driven, and Object Oriented ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Object-Oriented Programming (OOP) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
OOP Terminology ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Object Model Analogy ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Microsoft’s Visual Studio 2005 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Steps for Planning & Writing  C# Programs ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
C# Application Files ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Files for a C# Project Form files Project file Solution file Solution user options file C# File that runs the program Project user option file Resource File for the form
The Visual Studio Environment ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Default Environment Settings ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Begin a C# Project ,[object Object],[object Object],Select Visual C# Windows Select the Windows Application template Enter the Project Name
The Visual Studio IDE Toolbox Main Document window Solution Explorer Properties window    Each window can be moved, resized, closed, or customized
IDE Toolbars ,[object Object],[object Object],[object Object],[object Object]
Toolbox & Document Window Pin Toolbox open with pushpin icon Use tab to change to Editor to edit code Form Designer tab – Use to create form Main Document window
Help Filte r Help with specific tasks Selected topic Help Search Index Results – Select   topic to display Help Favorites tab Help Contents tab Index tab
IDE  —  3 Modes of Operation ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Look at the IDE’s title bar to determine the current mode
Writing Your First C# Program – 1 ,[object Object],[object Object],[object Object],[object Object]
Writing Your First C# Program – 2 ,[object Object],[object Object],[object Object],[object Object],Click the pushpin icon to pin the Toolbox open Point to the Toolbox icon to make the Toolbox appear
Writing Your First C# Program – 3 ,[object Object],[object Object],[object Object]
Writing Your First C# Program – 4 ,[object Object],[object Object],[object Object]
Writing Your First C# Program – 5 ,[object Object],Double-click the Label tool to add a Label control to the form
Writing Your First C# Program – 6 ,[object Object],[object Object],[object Object],Draw the button control using the crosshair pointer Snap line
Writing Your First C# Program – 7 ,[object Object],[object Object],Point to a resizing handle and drag to resize Resize a selected control Point inside control and drag to a new location Move a selected control Press the Delete key Delete a selected control Click on it Select a control
Writing Your First C# Program – 8 ,[object Object],[object Object],[object Object],[object Object]
Set Properties in the  Properties Window Name of selected object Properties window Object box Settings box Namespace  and class of selected object Selected property
Using the Properties Window ,[object Object],[object Object],[object Object],Sort the Properties list alphabetically Type the new name in the Settings box The new name appears in the Object box
Writing Your First C# Program – 9 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Label is empty and selected
Lock the Controls ,[object Object],[object Object],Right-click on the form and select Lock Controls A button that is selected and locked
Writing Your First C# Program – 10 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Writing Your First C# Program – 11 ,[object Object],[object Object],[object Object],Form’s   Text property appears in the title bar Icon indicates that the form’s controls are locked
Changing the Name of a Form ,[object Object],[object Object],[object Object],Change the name of the form’s file, keeping the .cs extension
Events ,[object Object],[object Object],[object Object]
C# Event Handlers ,[object Object],[object Object],[object Object],[object Object],[object Object]
Writing Code ,[object Object],[object Object],[object Object],[object Object],[object Object]
Comment Statements ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
C# Statements ,[object Object],[object Object],[object Object],[object Object]
Assignment Statements ,[object Object],[object Object],[object Object],messageLabel.Text = "Hello World";
Execute a Method  to End a Program ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Write Code for the First Program ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Write the Event Handlers Editor tab Form Designer tab Comment statement Assignment statement Execute the Close method to end the program run
Run the Program  (1 of 2) ,[object Object],[object Object],[object Object],[object Object],Form for the running   application IDE title bar shows (Running)
Run the Program  (2 of 2) Click the Display button The message appears in the label Click the Exit button to end the program and return to Design time
Saving a Project  (1 of 2) ,[object Object],[object Object],[object Object]
Saving a Project  (2 of 2) ,[object Object],[object Object],[object Object],Do not select this option
Modify a Project ,[object Object],[object Object],Select the Events button to display the events for the selected control Selected event Properties button Event handler for the Click event – Double click to go quickly to the method in the Editor
Print the Code ,[object Object],[object Object]
Finding & Fixing Errors ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Compiling a Project ,[object Object],[object Object],[object Object],[object Object]
Modifying an Event Handler ,[object Object],[object Object],[object Object],Select the event Delete the method name or drop down the list to select a new method name
Naming Rules and Conventions ,[object Object],[object Object],[object Object]
Naming Rules ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Naming Conventions  (1 of 2) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Naming Conventions  (2 of 2) ,[object Object],[object Object],[object Object],[object Object]
Visual Studio Help Additional Info ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]

Weitere ähnliche Inhalte

Was ist angesagt?

Visual Basic IDE Introduction
Visual Basic IDE IntroductionVisual Basic IDE Introduction
Visual Basic IDE IntroductionAhllen Javier
 
Visual basic ppt for tutorials computer
Visual basic ppt for tutorials computerVisual basic ppt for tutorials computer
Visual basic ppt for tutorials computersimran153
 
Visual basic 6.0
Visual basic 6.0Visual basic 6.0
Visual basic 6.0Aarti P
 
Presentation on visual basic 6 (vb6)
Presentation on visual basic 6 (vb6)Presentation on visual basic 6 (vb6)
Presentation on visual basic 6 (vb6)pbarasia
 
Best practices for upgrading vb 6.0 projects to vb.net
Best practices for upgrading vb 6.0 projects to vb.netBest practices for upgrading vb 6.0 projects to vb.net
Best practices for upgrading vb 6.0 projects to vb.netajmal_fuuast
 
Vb6.0 Introduction
Vb6.0 IntroductionVb6.0 Introduction
Vb6.0 IntroductionTennyson
 
Introduction to Visual Basic 6.0 Fundamentals
Introduction to Visual Basic 6.0 FundamentalsIntroduction to Visual Basic 6.0 Fundamentals
Introduction to Visual Basic 6.0 FundamentalsSanay Kumar
 
Chapter 03 - Program Coding and Design
Chapter 03 - Program Coding and DesignChapter 03 - Program Coding and Design
Chapter 03 - Program Coding and Designpatf719
 

Was ist angesagt? (20)

Visusual basic
Visusual basicVisusual basic
Visusual basic
 
Visual Basic IDE Introduction
Visual Basic IDE IntroductionVisual Basic IDE Introduction
Visual Basic IDE Introduction
 
Vb tutorial
Vb tutorialVb tutorial
Vb tutorial
 
Chapter 01
Chapter 01Chapter 01
Chapter 01
 
Visual basic
Visual basicVisual basic
Visual basic
 
Microsoft visual basic 6
Microsoft visual basic 6Microsoft visual basic 6
Microsoft visual basic 6
 
Visual basic ppt for tutorials computer
Visual basic ppt for tutorials computerVisual basic ppt for tutorials computer
Visual basic ppt for tutorials computer
 
Vb basics
Vb basicsVb basics
Vb basics
 
Vb unit t 1.1
Vb unit t 1.1Vb unit t 1.1
Vb unit t 1.1
 
Visual Basic Controls ppt
Visual Basic Controls pptVisual Basic Controls ppt
Visual Basic Controls ppt
 
Visual basic
Visual basicVisual basic
Visual basic
 
Visual basic 6.0
Visual basic 6.0Visual basic 6.0
Visual basic 6.0
 
Presentation on visual basic 6 (vb6)
Presentation on visual basic 6 (vb6)Presentation on visual basic 6 (vb6)
Presentation on visual basic 6 (vb6)
 
Best practices for upgrading vb 6.0 projects to vb.net
Best practices for upgrading vb 6.0 projects to vb.netBest practices for upgrading vb 6.0 projects to vb.net
Best practices for upgrading vb 6.0 projects to vb.net
 
Vb6.0 Introduction
Vb6.0 IntroductionVb6.0 Introduction
Vb6.0 Introduction
 
Introduction to Visual Basic 6.0 Fundamentals
Introduction to Visual Basic 6.0 FundamentalsIntroduction to Visual Basic 6.0 Fundamentals
Introduction to Visual Basic 6.0 Fundamentals
 
Chapter 03 - Program Coding and Design
Chapter 03 - Program Coding and DesignChapter 03 - Program Coding and Design
Chapter 03 - Program Coding and Design
 
Meaning Of VB
Meaning Of VBMeaning Of VB
Meaning Of VB
 
Visual programming
Visual programmingVisual programming
Visual programming
 
Chapter03 Ppt
Chapter03 PptChapter03 Ppt
Chapter03 Ppt
 

Andere mochten auch

Bca sem 5 c# practical
Bca sem 5 c# practicalBca sem 5 c# practical
Bca sem 5 c# practicalHitesh Patel
 
[Development Simply Put] Events & Delegates In C# - Win Forms Controls
[Development Simply Put] Events & Delegates In C# - Win Forms Controls[Development Simply Put] Events & Delegates In C# - Win Forms Controls
[Development Simply Put] Events & Delegates In C# - Win Forms ControlsAhmed Tarek Hasan
 
12 iec t1_s1_oo_ps_session_17
12 iec t1_s1_oo_ps_session_1712 iec t1_s1_oo_ps_session_17
12 iec t1_s1_oo_ps_session_17Niit Care
 
c# events, delegates and lambdas
c# events, delegates and lambdasc# events, delegates and lambdas
c# events, delegates and lambdasFernando Galvan
 
Java event processing model in c# and java
Java  event processing model in c# and javaJava  event processing model in c# and java
Java event processing model in c# and javaTech_MX
 
Spf chapter 03 WinForm
Spf chapter 03 WinFormSpf chapter 03 WinForm
Spf chapter 03 WinFormHock Leng PUAH
 
Integrate jQuery PHP MySQL project to JOOMLA web site
Integrate jQuery PHP MySQL project to JOOMLA web siteIntegrate jQuery PHP MySQL project to JOOMLA web site
Integrate jQuery PHP MySQL project to JOOMLA web siteHock Leng PUAH
 
C# Starter L06-Delegates, Event Handling and Extension Methods
C# Starter L06-Delegates, Event Handling and Extension MethodsC# Starter L06-Delegates, Event Handling and Extension Methods
C# Starter L06-Delegates, Event Handling and Extension MethodsMohammad Shaker
 
JAVA Training Syllabus Course
JAVA Training Syllabus CourseJAVA Training Syllabus Course
JAVA Training Syllabus CourseTOPS Technologies
 
C# Delegates and Event Handling
C# Delegates and Event HandlingC# Delegates and Event Handling
C# Delegates and Event HandlingJussi Pohjolainen
 
Visual basic asp.net programming introduction
Visual basic asp.net programming introductionVisual basic asp.net programming introduction
Visual basic asp.net programming introductionHock Leng PUAH
 
tybsc it asp.net full unit 1,2,3,4,5,6 notes
tybsc it asp.net full unit 1,2,3,4,5,6 notestybsc it asp.net full unit 1,2,3,4,5,6 notes
tybsc it asp.net full unit 1,2,3,4,5,6 notesWE-IT TUTORIALS
 
What is Software? Relationship between Hardware & Software. Purposes of Software
What is Software?Relationship between Hardware & Software.Purposes of SoftwareWhat is Software?Relationship between Hardware & Software.Purposes of Software
What is Software? Relationship between Hardware & Software. Purposes of SoftwareRifat Touhid
 

Andere mochten auch (20)

C#/.NET Little Wonders
C#/.NET Little WondersC#/.NET Little Wonders
C#/.NET Little Wonders
 
C#2008 Black Book
C#2008 Black BookC#2008 Black Book
C#2008 Black Book
 
C#2008 Black Book
C#2008 Black BookC#2008 Black Book
C#2008 Black Book
 
Bca sem 5 c# practical
Bca sem 5 c# practicalBca sem 5 c# practical
Bca sem 5 c# practical
 
[Development Simply Put] Events & Delegates In C# - Win Forms Controls
[Development Simply Put] Events & Delegates In C# - Win Forms Controls[Development Simply Put] Events & Delegates In C# - Win Forms Controls
[Development Simply Put] Events & Delegates In C# - Win Forms Controls
 
12 iec t1_s1_oo_ps_session_17
12 iec t1_s1_oo_ps_session_1712 iec t1_s1_oo_ps_session_17
12 iec t1_s1_oo_ps_session_17
 
c# events, delegates and lambdas
c# events, delegates and lambdasc# events, delegates and lambdas
c# events, delegates and lambdas
 
Spf chapter10 events
Spf chapter10 eventsSpf chapter10 events
Spf chapter10 events
 
Java event processing model in c# and java
Java  event processing model in c# and javaJava  event processing model in c# and java
Java event processing model in c# and java
 
Spf chapter 03 WinForm
Spf chapter 03 WinFormSpf chapter 03 WinForm
Spf chapter 03 WinForm
 
Integrate jQuery PHP MySQL project to JOOMLA web site
Integrate jQuery PHP MySQL project to JOOMLA web siteIntegrate jQuery PHP MySQL project to JOOMLA web site
Integrate jQuery PHP MySQL project to JOOMLA web site
 
C# Starter L06-Delegates, Event Handling and Extension Methods
C# Starter L06-Delegates, Event Handling and Extension MethodsC# Starter L06-Delegates, Event Handling and Extension Methods
C# Starter L06-Delegates, Event Handling and Extension Methods
 
JAVA Training Syllabus Course
JAVA Training Syllabus CourseJAVA Training Syllabus Course
JAVA Training Syllabus Course
 
C# Delegates and Event Handling
C# Delegates and Event HandlingC# Delegates and Event Handling
C# Delegates and Event Handling
 
Intro++ to C#
Intro++ to C#Intro++ to C#
Intro++ to C#
 
Windowforms controls c#
Windowforms controls c#Windowforms controls c#
Windowforms controls c#
 
Visual basic asp.net programming introduction
Visual basic asp.net programming introductionVisual basic asp.net programming introduction
Visual basic asp.net programming introduction
 
tybsc it asp.net full unit 1,2,3,4,5,6 notes
tybsc it asp.net full unit 1,2,3,4,5,6 notestybsc it asp.net full unit 1,2,3,4,5,6 notes
tybsc it asp.net full unit 1,2,3,4,5,6 notes
 
C#/.NET Little Pitfalls
C#/.NET Little PitfallsC#/.NET Little Pitfalls
C#/.NET Little Pitfalls
 
What is Software? Relationship between Hardware & Software. Purposes of Software
What is Software?Relationship between Hardware & Software.Purposes of SoftwareWhat is Software?Relationship between Hardware & Software.Purposes of Software
What is Software? Relationship between Hardware & Software. Purposes of Software
 

Ähnlich wie Ch01

COM 211 PRESENTATION.pptx
COM 211 PRESENTATION.pptxCOM 211 PRESENTATION.pptx
COM 211 PRESENTATION.pptxAnasYunusa
 
hjksjdhksjhcksjhckjhskdjhcskjhckjdppt.pptx
hjksjdhksjhcksjhckjhskdjhcskjhckjdppt.pptxhjksjdhksjhcksjhckjhskdjhcskjhckjdppt.pptx
hjksjdhksjhcksjhckjhskdjhcskjhckjdppt.pptxEliasPetros
 
WP7 HUB_Introducción a Silverlight
WP7 HUB_Introducción a SilverlightWP7 HUB_Introducción a Silverlight
WP7 HUB_Introducción a SilverlightMICTT Palma
 
LECTURE 12 WINDOWS FORMS PART 2.pptx
LECTURE 12 WINDOWS FORMS PART 2.pptxLECTURE 12 WINDOWS FORMS PART 2.pptx
LECTURE 12 WINDOWS FORMS PART 2.pptxAOmaAli
 
Introduction to visual basic 6 (1)
Introduction to visual basic 6 (1)Introduction to visual basic 6 (1)
Introduction to visual basic 6 (1)Mark Vincent Cantero
 
Code camp 2011 Getting Started with IOS, Una Daly
Code camp 2011 Getting Started with IOS, Una DalyCode camp 2011 Getting Started with IOS, Una Daly
Code camp 2011 Getting Started with IOS, Una DalyUna Daly
 
Semi Detailed Lesson Plan in Programming Languages
Semi Detailed Lesson Plan in Programming LanguagesSemi Detailed Lesson Plan in Programming Languages
Semi Detailed Lesson Plan in Programming LanguagesManila Central University
 
VB6_INTRODUCTION.ppt
VB6_INTRODUCTION.pptVB6_INTRODUCTION.ppt
VB6_INTRODUCTION.pptBhuvanaR13
 
06 win forms
06 win forms06 win forms
06 win formsmrjw
 
The visual studio start page is shown in the figure below
The visual studio start page is shown in the figure belowThe visual studio start page is shown in the figure below
The visual studio start page is shown in the figure belowTan Ps
 
Membangun Desktop App
Membangun Desktop AppMembangun Desktop App
Membangun Desktop AppFajar Baskoro
 
Visual basic concepts
Visual basic conceptsVisual basic concepts
Visual basic conceptsmelody77776
 
Programming basics
Programming basicsProgramming basics
Programming basicsSenri DLN
 
Lecture 1 uml with java implementation
Lecture 1 uml with java implementationLecture 1 uml with java implementation
Lecture 1 uml with java implementationthe_wumberlog
 

Ähnlich wie Ch01 (20)

Visual studio.net
Visual studio.netVisual studio.net
Visual studio.net
 
4.C#
4.C#4.C#
4.C#
 
COM 211 PRESENTATION.pptx
COM 211 PRESENTATION.pptxCOM 211 PRESENTATION.pptx
COM 211 PRESENTATION.pptx
 
hjksjdhksjhcksjhckjhskdjhcskjhckjdppt.pptx
hjksjdhksjhcksjhckjhskdjhcskjhckjdppt.pptxhjksjdhksjhcksjhckjhskdjhcskjhckjdppt.pptx
hjksjdhksjhcksjhckjhskdjhcskjhckjdppt.pptx
 
WP7 HUB_Introducción a Silverlight
WP7 HUB_Introducción a SilverlightWP7 HUB_Introducción a Silverlight
WP7 HUB_Introducción a Silverlight
 
Vb 6ch123
Vb 6ch123Vb 6ch123
Vb 6ch123
 
Vb6.0 intro
Vb6.0 introVb6.0 intro
Vb6.0 intro
 
LECTURE 12 WINDOWS FORMS PART 2.pptx
LECTURE 12 WINDOWS FORMS PART 2.pptxLECTURE 12 WINDOWS FORMS PART 2.pptx
LECTURE 12 WINDOWS FORMS PART 2.pptx
 
Introduction to visual basic 6 (1)
Introduction to visual basic 6 (1)Introduction to visual basic 6 (1)
Introduction to visual basic 6 (1)
 
Code camp 2011 Getting Started with IOS, Una Daly
Code camp 2011 Getting Started with IOS, Una DalyCode camp 2011 Getting Started with IOS, Una Daly
Code camp 2011 Getting Started with IOS, Una Daly
 
Semi Detailed Lesson Plan in Programming Languages
Semi Detailed Lesson Plan in Programming LanguagesSemi Detailed Lesson Plan in Programming Languages
Semi Detailed Lesson Plan in Programming Languages
 
VB6_INTRODUCTION.ppt
VB6_INTRODUCTION.pptVB6_INTRODUCTION.ppt
VB6_INTRODUCTION.ppt
 
Visual C# 2010
Visual C# 2010Visual C# 2010
Visual C# 2010
 
06 win forms
06 win forms06 win forms
06 win forms
 
The visual studio start page is shown in the figure below
The visual studio start page is shown in the figure belowThe visual studio start page is shown in the figure below
The visual studio start page is shown in the figure below
 
Membangun Desktop App
Membangun Desktop AppMembangun Desktop App
Membangun Desktop App
 
Ms vb
Ms vbMs vb
Ms vb
 
Visual basic concepts
Visual basic conceptsVisual basic concepts
Visual basic concepts
 
Programming basics
Programming basicsProgramming basics
Programming basics
 
Lecture 1 uml with java implementation
Lecture 1 uml with java implementationLecture 1 uml with java implementation
Lecture 1 uml with java implementation
 

Kürzlich hochgeladen

Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 

Kürzlich hochgeladen (20)

Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 

Ch01

  • 1. Programming in Visual C# 2005 Chapter 1 Introduction to Programming and C#
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13. Files for a C# Project Form files Project file Solution file Solution user options file C# File that runs the program Project user option file Resource File for the form
  • 14.
  • 15.
  • 16.
  • 17. The Visual Studio IDE Toolbox Main Document window Solution Explorer Properties window  Each window can be moved, resized, closed, or customized
  • 18.
  • 19. Toolbox & Document Window Pin Toolbox open with pushpin icon Use tab to change to Editor to edit code Form Designer tab – Use to create form Main Document window
  • 20. Help Filte r Help with specific tasks Selected topic Help Search Index Results – Select topic to display Help Favorites tab Help Contents tab Index tab
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30. Set Properties in the Properties Window Name of selected object Properties window Object box Settings box Namespace and class of selected object Selected property
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45. Write the Event Handlers Editor tab Form Designer tab Comment statement Assignment statement Execute the Close method to end the program run
  • 46.
  • 47. Run the Program (2 of 2) Click the Display button The message appears in the label Click the Exit button to end the program and return to Design time
  • 48.
  • 49.
  • 50.
  • 51.
  • 52.
  • 53.
  • 54.
  • 55.
  • 56.
  • 57.
  • 58.
  • 59.

Hinweis der Redaktion

  1. Complete objectives from the text: at the completion of this chapter, you will be able to ... 1. Describe the process of visual program design and development. 2. Explain the term object-oriented programming. 3. Explain the concepts of classes, objects, properties, methods, and events. 4. List and describe the three steps for writing a C# program. 5. Describe the various files that make up a C# project. 6. Identify the elements in the Visual Studio environment. 7. Define design time , run time , and debug time. 8. Write, run, save, print, and modify your first C# program. 9. Identify syntax errors, run-time errors, and logic errors. 10. Look up C# topics in Help.
  2. Click on each element type to see an arrow to the examples in the figures.
  3. GUI is pronounced "gooey".
  4. OOP terminology is used throughout the text. The theory is presented in Chapter 12.
  5. Express Editions are available for (currently) free download from Microsoft. The version that is bundled with this text is an evaluation version of the Professional Edition. The evaluation version can be used for 180 days. The version supplied to schools in the Academic Alliance is the Professional Edition. All programs in this text can be done with the Express Edition and Visual Web Developer (also a free download from Microsoft).
  6. Planning: Design the user interface—draw a sketch of the screens the user will see when running the project; include forms and all controls that are to be used including the names to be assigned Plan the properties—for each object write down the properties that you plan to set or change during the design of the form Plan the C# code—plan the methods that will execute when the project runs including determining which events require action to be taken and then make a step-by-step plan for the actions. Use english-like pseudocode for the actions, rather than follow C# syntax. Programming: Define the user interface--create forms and controls Set the properties--give each object a name and define attributes such as the contents of a label. Write the C# code—use C# programming statements to carry out the actions needed by the program
  7. The next slide shows the files in a project.
  8. HelloForm.cs – Code written by the programmer HelloForm.Designer.cs – Code automatically generated by the Form Designer. A beginning programmer should ignore this file. HelloForm.resx – Resource file for the form. Can contain graphics and text strings for display on the form. HelloWorld.csproj – Project file.A text file that lists the files included in the project. HelloWorld.sln – Solution file. A text file that lists the projects included in the solution. HelloWorld.suo – Solution User Options file. Keeps the state of the environment from one run to the next. If you delete this file, the IDE reverts to the defaults. Program.cs – An automatically-generated file that is used to begin execution of a C# application. In Chapter 6 we edit this file if we want to change the startup form. HelloWorld.csproj.user – Project User Option file. Holds settings for the state of the environment for the project.
  9. Form Designer – Lay out the form (the user interface), adding the controls, such as buttons and boxes. Editor – Write and edit the C# code. Compiler – Convert the C# code into runnable code (MSIL – Microsoft Intermediate Language). Debugger – Includes tools to single-step through program statements and display intermediate results. Covered in Chapter 4. Object Browser – Shows classes, objects, properties, methods, and events of all system elements, as well as classes you write. Covered in Chapter 12. Help –Includes extensive documentation, both local and on the Web. Referred to as MSDN – Microsoft Developers’ Network.
  10. The title bar indicates the current mode. For Design Time, only the solution name displays. For Run Time, the solution name and (Running) display. For Debug Time, the solution name and (Debugging) display.
  11. Note: You also can begin a new project from the Start Page, if it is displaying. This text assumes it to be closed.
  12. In the Options dialog box, select Show all settings . Expand the Environment node and click on Startup . Drop down the list for At startup and select Show empty environment . By default, Show Start Page is selected.
  13. Draw the sketch by hand and label the form and controls with the names you plan to give them.
  14. Snap lines appear as you draw or move controls on the form. They can help align lefts, rights, or the text base line of controls.
  15. Select a control on the form and the control’s properties appear in the Properties window. The default name of the first label is “label1” and the Text property is also “label1”. The namespace is the library location that holds the definition of the Label class.
  16. Set the AutoSize property to False so that it doesn’t disappear when deselected.
  17. Naming conventions are covered later. This style is called camel casing, and is the preferred convention for naming objects.
  18. The next slide describes changing the form’s name and file name.
  19. If you change the name of the form’s class in the properties window, you also must manually change the name of the file. It’s much better to change the name of the file and allow the IDE to rename the form’s class to match.
  20. Details for comments, statement terminators, assignment statements, and executing a method are covered in the following slides.
  21. Changing the name or deleting an event-handling method causes an error unless the change is also made in the Properties window. C# creates a program statement that is hidden in the FormName.Designer.cs file that assigns the method to the event. Although you can change the line of code using the Editor, the better solution is to make the change in the Properties window.
  22. The next two slides detail the rules and conventions
  23. MSDN – Microsoft Developer Network library. A good way to begin using Help is to view the topics that demonstrate how to look up topics in Help.