Tải bản đầy đủ - 0 (trang)
Chapter 2. Introduction to the Visual C# 2005 Express Edition IDE

Chapter 2. Introduction to the Visual C# 2005 Express Edition IDE

Tải bản đầy đủ - 0trang

Chapter2.IntroductiontotheVisualC#

2005ExpressEditionIDE

Seeingisbelieving.

Proverb

Formeverfollowsfunction.

LouisHenriSullivan

Intelligence...isthefacultyofmakingartificial

objects,especiallytoolstomaketools.

Henri-LouisBergson

OBJECTIVES

Inthischapter,youwilllearn:

ThebasicsoftheVisualStudioIntegratedDevelopment

Environment(IDE)thatassistsyouinwriting,runningand

debuggingyourVisualC#programs.

VisualStudio'shelpfeatures.

KeycommandscontainedintheIDE'smenusandtoolbars.

ThepurposeofthevariouskindsofwindowsintheVisual

Studio2005IDE.

Whatvisualprogrammingisandhowitsimplifiesand

speedsprogramdevelopment.



Tocreate,compileandexecuteasimpleVisualC#program

thatdisplaystextandanimageusingtheVisualStudioIDE

andthetechniqueofvisualprogramming.



[Page36]



Outline

2.1 Introduction

2.2 OverviewoftheVisualStudio2005IDE

2.3 MenuBarandToolbar

2.4 NavigatingtheVisualStudio2005IDE











2.4.1 SolutionExplorer

2.4.2 Toolbox

2.4.3 PropertiesWindow



2.5 UsingHelp

2.6 UsingVisualProgrammingtoCreateaSimpleProgramDisplaying

TextandanImage

2.7 Wrap-Up

2.8 WebResources

Summary

Terminology

Self-ReviewExercises

AnswerstoSelf-ReviewExercises

Exercises







[Page36(continued)]



2.1.Introduction

VisualStudio®2005isMicrosoft'sIntegratedDevelopment

Environment(IDE)forcreating,runninganddebugging

programs(alsocalledapplications)writteninavarietyof.NET

programminglanguages.Inthischapter,weprovidean

overviewoftheVisualStudio2005IDEanddemonstratehowto

createasimpleVisualC#programbydragginganddropping

predefinedbuildingblocksintoplaceatechniquecalledvisual

programming.ThischapterisspecifictoVisualC#Microsoft's

implementationofEcmastandardC#.







[Page36(continued)]



2.2.OverviewoftheVisualStudio2005IDE

TherearemanyversionsofVisualStudioavailable.Forthis

book,weusedtheMicrosoftVisualC#2005Express

Edition,whichsupportsonlytheVisualC#programming

language.MicrosoftalsooffersafullversionofVisualStudio

2005,whichincludessupportforotherlanguagesinadditionto

VisualC#,suchasVisualBasicandVisualC++.Ourscreen

capturesanddiscussionsfocusontheIDEoftheVisualC#

2005ExpressEdition.Weassumethatyouhavesome

familiaritywithWindows.

Again,weusefontstodistinguishbetweenIDEfeatures(such

asmenunamesandmenuitems)andotherelementsthat

appearintheIDE.WeemphasizeIDEfeaturesinasans-serif

boldHelveticafont(e.g.,Filemenu)andemphasizeother

elements,suchasfilenames(e.g.,Form1.cs)andproperty

names(discussedinSection2.4),inasans-serifLucidafont.



IntroductiontoMicrosoftVisualC#2005

ExpressEdition

TostartMicrosoftVisualC#2005ExpressEditioninWindows

XP,selectStart>AllPrograms>VisualC#2005ExpressEdition.For

Windows2000users,selectStart>Programs>VisualC#2005

ExpressEdition.OncetheExpressEditionbeginsexecution,the

StartPagedisplays(Fig.2.1).Dependingonyourversionof

VisualStudio,yourStartPagemaylookdifferent.Fornew

programmersunfamiliarwithVisualC#,theStartPagecontainsa

listoflinkstoresourcesintheVisualStudio2005IDEandon

theInternet.Fromthispointforward,wewillrefertotheVisual

Studio2005IDEsimplyas"VisualStudio"or"theIDE."For



experienceddevelopers,thispageprovideslinkstothelatest

developmentsinVisualC#(suchasupdatesandbugfixes)and

toinformationonadvancedprogrammingtopics.Onceyoustart

exploringtheIDE,youcanreturntotheStartPagebyselecting

thepagefromthelocationbardrop-downmenu(Fig.2.2),by

selectingView>OtherWindows>StartPageorbyclickingtheStart

PageiconfromtheIDE'sToolbar(Fig.2.9).Wediscussthe

ToolbaranditsvariousiconsinSection2.3.Weusethe>

charactertoindicatetheselectionofamenucommandfroma

menu.Forexample,weusethenotationFile>OpenFileto

indicatethatyoushouldselecttheOpenFilecommandfromthe

Filemenu.



[Page37]

Figure2.1.StartPageinVisualC#2005Express

Edition.



[Viewfullsizeimage]



Figure2.2.DisplayingaWebpageinVisual

Studio.

(Thisitemisdisplayedonpage38intheprintversion)



[Viewfullsizeimage]



LinksontheStartPage

TheStartPagelinksareorganizedintosectionsRecentProjects,

GettingStarted,VisualC#ExpressHeadlinesandMSDN:VisualStudio

2005thatcontainlinkstohelpfulprogrammingresources.

ClickinganylinkontheStartPagedisplaystherelevant

informationassociatedwiththespecificlink.Werefertosingle

clickingwiththeleftmousebuttonasselectingor

clicking;werefertodoubleclickingwiththeleftmousebutton

simplyasdoubleclicking.



[Page38]



TheRecentProjectssectioncontainsinformationonprojectsyou

haverecentlycreatedormodified.Youcanalsoopenexisting

projectsorcreatenewonesbyclickingthelinksinthesection.

TheGettingStartedsectionfocusesonusingtheIDEtocreate

programs,learningVisualC#,connectingtotheVisualC#

developercommunity(i.e.,othersoftwaredeveloperswith

whomyoucancommunicatethroughnewsgroupsandWeb

sites)andprovidingvariousdevelopmenttoolssuchasstarter

kits.Forexample,clickingthelinkUseaStarterKitprovidesyou

withresourcesandlinksforbuildingasimplescreensaver

applicationoramoviecollectionapplication.Thescreensaver

applicationbuildsascreensaverthatdisplayscurrentnews

articles.Themoviecollectionstarterkitbuildsanapplication

thatletsyoumaintainacatalogofyourDVDsandVHSmovies,

ortheapplicationcanbechangedtotrackanythingelseyou

mightcollect(e.g.,CDs,videogames).

TheVisualC#ExpressHeadlinesandMSDN:VisualStudio2005

sectionsprovidelinkstoinformationaboutprogrammingin

VisualC#,includingatourofthelanguage,newVisualC#2005

featuresandonlinecourses.Toaccessmoreextensive

informationonVisualStudio,youcanbrowsetheMSDN

(MicrosoftDeveloperNetwork)onlinelibraryat

msdn.microsoft.com.TheMSDNsitecontainsarticles,

downloadsandtutorialsontechnologiesofinteresttoVisual

Studiodevelopers.YoucanalsobrowsetheWebfromtheIDE

usingInternetExplorer.TorequestaWebpage,typeitsURL

intothelocationbar(Fig.2.2)andpresstheEnterkeyyour

computer,ofcourse,mustbeconnectedtotheInternet.(Ifthe

locationbarisnotalreadypresentintheIDE,selectView>Other

Windows>ShowBrowser.)TheWebpagethatyouwishtoview

willappearasanothertab,whichyoucanselect,insidethe

VisualStudioIDE(Fig.2.2).



[Page39]



CustomizingtheIDEandCreatingaNewProject

TobeginprogramminginVisualC#,youmustcreateanew

projectoropenanexistingone.Therearetwowaystocreatea

newprojectoropenanexistingproject.Youcanselecteither

File>NewProject...orFile>OpenProject...fromtheFilemenu,

whichcreatesanewprojectoropensanexistingproject,

respectively.FromtheStartPage,undertheRecentProjects

section,youcanalsoclickthelinksCreate:ProjectorOpen:

Project/Solution.Aprojectisagroupofrelatedfiles,suchasthe

VisualC#codeandanyimagesthatmightmakeupaprogram.

VisualStudio2005organizesprogramsintoprojectsand

solutions,whichcontainoneormoreprojects.Multiple-project

solutionsareusedtocreatelarge-scaleprograms.Eachofthe

programswecreateinthisbookconsistsofasingleproject.

SelectFile>NewProject...ortheCreate:Project...linkontheStart

PagetodisplaytheNewProjectdialog(Fig.2.3).Dialogsare

windowsthatfacilitateuser-computercommunication.Wewill

discussthedetailedprocessofcreatingnewprojects

momentarily.



Figure2.3.NewProjectdialog.



[Viewfullsizeimage]



Tài liệu bạn tìm kiếm đã sẵn sàng tải về

Chapter 2. Introduction to the Visual C# 2005 Express Edition IDE

Tải bản đầy đủ ngay(0 tr)

×