VB2008´ÓÈëÃŵ½¾«Í¨(PDF¸ñʽӢÎÄ°æ)-µÚ6²¿·Ö
°´¼üÅÌÉÏ·½Ïò¼ü ¡û »ò ¡ú ¿É¿ìËÙÉÏÏ·ҳ£¬°´¼üÅÌÉ쵀 Enter ¼ü¿É»Øµ½±¾ÊéĿ¼ҳ£¬°´¼üÅÌÉÏ·½Ïò¼ü ¡ü ¿É»Øµ½±¾Ò³¶¥²¿£¡
¡ª¡ª¡ª¡ªÎ´ÔĶÁÍꣿ¼ÓÈëÊéÇ©ÒѱãÏ´μÌÐøÔĶÁ£¡
achieve¡¡many¡¡goals£»¡¡but¡¡you¡¡are¡¡left¡¡wondering¡¡what¡¡techniques¡¡to¡¡use¡¡when¡£¡¡This¡¡book¡¡is¡¡here¡¡¡¡
to¡¡answer¡¡your¡¡questions¡£¡¡
¡¡¡¡¡¡¡¡¡¡This¡¡book¡¡is¡¡not¡¡a¡¡reference¡¡to¡¡all¡¡of¡¡the¡¡features¡¡of¡¡the¡¡Visual¡¡Basic¡¡programming¡¡language¡£¡¡¡¡
I¡¡don¡¯t¡¡explain¡¡the¡¡esoteric¡¡Visual¡¡Basic¡¡features¡£¡¡I¡¡stick¡¡to¡¡the¡¡Visual¡¡Basic¡¡programming¡¡features¡¡¡¡
that¡¡you¡¡will¡¡use¡¡day¡¡in¡¡and¡¡day¡¡out¡£¡¡That¡¡does¡¡not¡¡mean¡¡that¡¡you¡¡will¡¡be¡¡missing¡¡certain¡¡Visual¡¡¡¡
Basic¡¡programming¡¡language¡¡constructs£»¡¡because¡¡I¡¡have¡¡covered¡¡all¡¡of¡¡the¡¡major¡¡features¡£¡¡¡¡
¡¡¡¡¡¡¡¡¡¡To¡¡get¡¡the¡¡full¡¡benefit¡¡of¡¡this¡¡book£»¡¡I¡¡suggest¡¡that¡¡you¡¡do¡¡the¡¡exercises¡¡at¡¡the¡¡end¡¡of¡¡the¡¡chapters¡£¡¡¡¡
The¡¡answers¡¡are¡¡available¡¡on¡¡the¡¡Apress¡¡web¡¡site¡¡£¨¡¡http£º//apress¡££©£»¡¡and¡¡you¡¡can¡¡cheat¡¡¡¡
and¡¡not¡¡do¡¡the¡¡exercises£»¡¡but¡¡I¡¡advise¡¡against¡¡that¡£¡¡
¡¡¡¡¡¡¡¡¡¡If¡¡you¡¡are¡¡a¡¡beginning¡¡programmer¡¡who¡¡has¡¡no¡¡clue¡¡about¡¡Visual¡¡Basic£»¡¡and¡¡you¡¡read¡¡this¡¡¡¡
book¡¡and¡¡do¡¡the¡¡exercises£»¡¡I¡¡believe¡¡that¡¡you¡¡will¡¡be¡¡a¡¡solid¡¡and¡¡knowledgeable¡¡Visual¡¡Basic¡¡¡¡
programmer¡¡by¡¡the¡¡end¡¡of¡¡the¡¡book¡£¡¡If¡¡that¡¡sounds¡¡like¡¡a¡¡big¡¡promise£»¡¡well£»¡¡yes¡¡it¡¡is¡£¡¡The¡¡chapter¡¡¡¡
text¡¡is¡¡intended¡¡to¡¡get¡¡you¡¡acquainted¡¡with¡¡the¡¡Visual¡¡Basic¡¡programming¡¡language¡¡and¡¡how¡¡to¡¡¡¡
apply¡¡its¡¡features¡£¡¡The¡¡exercises¡¡are¡¡intended¡¡to¡¡make¡¡sure¡¡you¡¡actually¡¡understand¡¡the¡¡Visual¡¡¡¡
Basic¡¡programming¡¡language¡¡and¡¡its¡¡features¡£¡¡
¡¡¡¡¡¡¡¡¡¡The¡¡chapter¡¡exercises¡¡are¡¡challenging¡£¡¡They¡¡cannot¡¡be¡¡solved¡¡within¡¡a¡¡few¡¡minutes¡£¡¡In¡¡fact£»¡¡¡¡
when¡¡I¡¡did¡¡all¡¡of¡¡the¡¡exercises£»¡¡it¡¡took¡¡me¡¡five¡¡working¡hour¡¡days¡¡to¡¡do¡¡all¡¡of¡¡them£¡¡¡
¡¡¡¡¡¡¡¡¡¡If¡¡you¡¡have¡¡any¡¡questions£»¡¡such¡¡as£»¡¡¡°So¡¡what¡¡was¡¡he¡¡trying¡¡to¡¡get¡¡at¡¡with¡¡that¡¡exercise£¿¡±¡¡I¡¡am¡¡¡¡
available¡¡on¡¡Skype¡¡with¡¡the¡¡user¡¡ID¡¡christianhgross¡£¡¡Please¡¡don¡¯t¡¡just¡¡ring¡¡me¡£¡¡First¡¡chat¡¡using¡¡¡¡
text£»¡¡and¡¡if¡¡necessary£»¡¡we¡¡can¡¡have¡¡a¡¡voice¡¡conversation¡£¡¡Also£»¡¡you¡¡can¡¡send¡¡e¡mail¡¡to¡¡me¡¡at¡¡¡¡
christianhgross@gmail¡£¡£¡¡
¡¡¡¡¡¡¡¡¡¡Thanks¡¡and¡¡good¡¡luck¡£¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡xix¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Page¡¡22¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Page¡¡23¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡
C¡¡¡¡H¡¡¡¡A¡¡¡¡P¡¡¡¡T¡¡¡¡E¡¡¡¡R¡¡¡¡¡¡¡¡¡¡1¡¡
¡ö¡¡¡ö¡¡¡ö¡¡
¡¡Ready£»¡¡Steady£»¡¡Go£¡¡¡
This¡¡book¡¡is¡¡about¡¡the¡¡Visual¡¡Basic¡¡programming¡¡language¡¡first¡¡and¡¡foremost¡£¡¡It¡¡is¡¡about¡¡¡¡
being¡¡a¡¡proficient¡¡Visual¡¡Basic¡¡programmer¡£¡¡Reading¡¡this¡¡book¡¡from¡¡cover¡¡to¡¡cover¡¡will¡¡not¡¡¡¡
make¡¡you¡¡a¡¡superstar£»¡¡but¡¡it¡¡will¡¡make¡¡you¡¡a¡¡programmer¡¡who¡¡understands¡¡what¡¡needs¡¡to¡¡be¡¡¡¡
done¡¡when¡¡writing¡¡robust£»¡¡stable£»¡¡and¡¡maintainable¡¡Visual¡¡Basic¡¡applications¡£¡¡
¡¡¡¡¡¡¡¡¡¡In¡¡this¡¡chapter£»¡¡you¡¯ll¡¡get¡¡started¡¡by¡¡acquiring¡¡the¡¡tools¡¡you¡¡need¡¡to¡¡develop¡¡Visual¡¡Basic¡¡¡¡
applications¡¡and¡¡taking¡¡those¡¡tools¡¡for¡¡a¡¡test¡¡spin¡£¡¡Along¡¡the¡¡way£»¡¡you¡¯ll¡¡create¡¡a¡¡couple¡¡Visual¡¡¡¡
Basic¡¡applications¡£¡¡
Downloading¡¡and¡¡Installing¡¡the¡¡Tools¡¡
Getting¡¡started¡¡with¡¡Visual¡¡Basic¡¡2008£»¡¡you¡¯re¡¡probably¡¡really¡¡excited¡¡about¡¡writing¡¡some¡¡code¡¡¡¡
that¡¡does¡¡something¡£¡¡It¡¯s¡¡like¡¡getting¡¡your¡¡driver¡¯s¡¡license¡¡and¡¡wanting¡¡to¡¡drive¡¡a¡¡car¡¡without¡¡¡¡
even¡¡thinking¡¡about¡¡where¡¡you¡¡want¡¡to¡¡go¡£¡¡You¡¡just¡¡want¡¡to¡¡drive¡£¡¡The¡¡great¡¡part¡¡of¡¡¡¡is¡¡that¡¡¡¡
you¡¡can¡¡start¡¡writing¡¡some¡¡code¡¡after¡¡you¡¡have¡¡installed¡¡either¡¡the¡¡¡¡software¡¡development¡¡¡¡
kit¡¡£¨¡¡SDK£©¡¡or¡¡a¡¡Visual¡¡Studio¡¡integrated¡¡development¡¡environment¡¡£¨IDE£©¡£¡¡Downloading¡¡¡¡
and¡¡installing¡¡the¡¡right¡¡environment¡¡is¡¡critical¡¡to¡¡taking¡¡your¡¡first¡¡step¡¡toward¡¡an¡¡enjoyable¡¡¡¡
coding¡¡experience¡£¡¡
¡öNote¡¡¡¡Software¡¡version¡¡numbers£»¡¡product¡¡descriptions£»¡¡and¡¡technologies¡¡can¡¡be¡¡confusing¡£¡¡Having¡¡¡¡
used¡¡Microsoft¡¡technologies¡¡for¡¡over¡¡a¡¡decade£»¡¡I¡¡can¡¡say¡¡that¡¡naming¡¡a¡¡technology¡¡or¡¡product¡¡has¡¡never¡¡been¡¡¡¡
Microsoft¡¯s¡¡strong¡¡point¡£¡¡The¡¡technologies¡¡have¡¡been¡¡great¡¡£¨for¡¡the¡¡most¡¡part£©£»¡¡but¡¡product¡¡classification¡¡and¡¡¡¡
identification¡¡have¡¡not¡¡been¡¡so¡¡great¡£¡¡Thus£»¡¡this¡¡book¡¡covers¡¡the¡¡Visual¡¡Basic¡¡2008¡¡programming¡¡language¡¡¡¡
that¡¡is¡¡used¡¡to¡¡write¡¡applications¡¡for¡¡the¡¡¡¡Framework¡£¡¡With¡¡Visual¡¡Basic¡¡2008£»¡¡the¡¡¡¡3¡£0¡¡and¡¡3¡£5¡¡¡¡
Frameworks¡¡are¡¡used¡£¡¡¡¡3¡£0¡¡gives¡¡you¡¡all¡¡of¡¡the¡¡essentials£»¡¡and¡¡¡¡3¡£5¡¡gives¡¡you¡¡the¡¡extras¡£¡¡
¡¡¡¡¡¡¡¡¡¡For¡¡the¡¡examples¡¡in¡¡this¡¡book£»¡¡you¡¯ll¡¡be¡¡using¡¡Visual¡¡Basic¡¡2008¡¡Express¡¡Edition£»¡¡because¡¡¡¡
it¡¯s¡¡freely¡¡available¡¡and¡¡has¡¡everything¡¡you¡¡need¡¡to¡¡get¡¡started¡¡with¡¡Visual¡¡Basic¡¡2008¡£¡¡The¡¡other¡¡¡¡
Express¡¡Edition¡¡IDEs¡¡available¡¡from¡¡Microsoft¡¡are¡¡tailored¡¡to¡¡different¡¡languages¡¡£¨C#¡¡and¡¡C£«£«£©¡¡¡¡
or£»¡¡in¡¡the¡¡case¡¡of¡¡Visual¡¡Web¡¡Developer¡¡Express£»¡¡specific¡¡functionality¡¡that¡¡is¡¡too¡¡restrictive¡¡for¡¡¡¡
our¡¡purposes¡£¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡1¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Page¡¡24¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡
2¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡CH¡¡AP¡¡T¡¡E¡¡R¡¡¡¡¡¡1¡¡¡¡¡¡¡ö¡¡¡¡¡¡¡¡R¡¡E¡¡A¡¡DY¡¡£»¡¡¡¡¡¡ST¡¡E¡¡A¡¡DY¡¡£»¡¡¡¡¡¡G¡¡O¡¡£¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Microsoft¡¡also¡¡offers¡¡full¡¡versions¡¡of¡¡the¡¡Visual¡¡Studio¡¡IDE£»¡¡such¡¡as¡¡the¡¡Standard£»¡¡Professional£»¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡and¡¡Team¡¡editions¡£¡¡Each¡¡of¡¡these¡¡editions¡¡has¡¡different¡¡features¡¡and¡¡different¡¡price¡¡tags¡£¡¡See¡¡the¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Microsoft¡¡Visual¡¡Studio¡¡web¡¡site¡¡£¨http£º//msdn2¡£microsoft¡£/en¡us/vstudio/default¡£aspx£©¡¡for¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡more¡¡information¡£¡¡If¡¡you¡¡already¡¡have¡¡Visual¡¡Studio¡¡2008¡¡Professional£»¡¡you¡¡can¡¡use¡¡that¡¡for¡¡the¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡examples¡¡in¡¡this¡¡book¡£¡¡That¡¡edition¡¡can¡¡do¡¡everything¡¡that¡¡Visual¡¡Basic¡¡2008¡¡Express¡¡can¡¡do£»¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡and¡¡in¡¡fact£»¡¡has¡¡many¡¡more¡¡options¡£¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡öNote¡¡¡¡I¡¡personally¡¡use¡¡Visual¡¡Studio¡¡Standard¡¡or¡¡Professional¡¡in¡¡bination¡¡with¡¡other¡¡tools¡¡such¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡as¡¡X¡develop¡¡and¡¡JustCode£¡¡¡from¡¡Omnicore¡¡£¨http£º//omnicore¡££©£»¡¡TestDriven¡¡£¨¡¡http£º//¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡testdriven/£©£»¡¡and¡¡NUnit¡¡£¨¡¡http£º//nunit¡£org£©¡£¡¡The¡¡Visual¡¡Studio¡¡products¡¡are¡¡very¡¡good£»¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡but¡¡others¡¡are¡¡available¡£¡¡Being¡¡a¡¡good¡¡developer¡¡means¡¡knowing¡¡which¡¡tools¡¡work¡¡best¡¡for¡¡you¡£¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Installing¡¡and¡¡downloading¡¡Visual¡¡Basic¡¡Express¡¡from¡¡the¡¡Microsoft¡¡web¡¡site¡¡involves¡¡the¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡transfer¡¡of¡¡large¡¡files¡£¡¡If¡¡you¡¡do¡¡not¡¡have¡¡a¡¡broadband¡¡connection£»¡¡I¡¡suggest¡¡that¡¡you¡¡install¡¡the¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡IDE¡¡from¡¡a¡¡CD¡¡instead¡£¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Downloading¡¡Visual¡¡Basic¡¡Express¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡The¡¡following¡¡is¡¡the¡¡procedure¡¡for¡¡downloading¡¡Visual¡¡Basic¡¡Express¡¡from¡¡the¡¡Microsoft¡¡web¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡site¡£¡¡By¡¡the¡¡time¡¡you¡¡are¡¡reading¡¡this¡¡book£»¡¡the¡¡procedure¡¡may¡¡be¡¡a¡¡bit¡¡different£»¡¡but¡¡it¡¡will¡¡be¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡similar¡¡enough¡¡that¡¡you¡¯ll¡¡be¡¡able¡¡to¡¡find¡¡and¡¡download¡¡the¡¡IDE¡¡package¡£¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡1¡£¡¡¡¡Go¡¡to¡¡http£º//microsoft¡£/express/¡£¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡2¡£¡¡¡¡Select¡¡the¡¡Download¡¡Now£¡¡¡link¡£¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡3¡£¡¡¡¡Scroll¡¡down¡¡to¡¡the¡¡Visual¡¡Basic¡¡2008¡¡Express¡¡Edition¡¡section£»¡¡as¡¡shown¡¡in¡¡Figure¡¡1¡1¡£¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡4¡£¡¡¡¡Click¡¡the¡¡Download¡¡link¡£¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡5¡£¡¡¡¡A¡¡dialog¡¡box¡¡appears£»¡¡asking¡¡where¡¡you¡¡want¡¡to¡¡store¡¡the¡¡downloaded¡¡file¡£¡¡The¡¡file¡¡that¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡you¡¡are¡¡downloading¡¡is¡¡a¡¡small¡¡bootstrap¡¡file£»¡¡which¡¡you¡¯ll¡¡use¡¡to¡¡begin¡¡the¡¡actual¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡installation¡¡of¡¡the¡¡Visual¡¡Basic¡¡Express¡¡IDE¡£¡¡Choose¡¡to¡¡save¡¡the¡¡file¡¡on¡¡the¡¡desktop¡£¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡These¡¡steps¡¡can¡¡be¡¡carried¡¡out¡¡very¡¡quickly¡ªprobably¡¡within¡¡a¡¡few¡¡minutes¡£¡¡Do¡¡not¡¡mistake¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡this¡¡procedure¡¡for¡¡downloading¡¡the¡¡plete¡¡Visual¡¡Basic¡¡Express¡¡application£»¡¡because¡¡that¡¯s¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡not¡¡what¡¡happened¡£¡¡The¡¡installation¡¡procedure¡¡will¡¡download¡¡the¡¡vast¡¡majority¡¡of¡¡the¡¡IDE¡£¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Page¡¡25¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡C¡¡H¡¡AP¡¡TE¡¡R¡¡¡¡¡¡1¡¡¡¡¡¡¡ö¡¡¡¡¡¡¡¡R¡¡E¡¡AD¡¡Y¡¡£»¡¡¡¡¡¡ST¡¡E¡¡AD¡¡Y¡¡£»¡¡¡¡¡¡G¡¡O£¡¡¡3¡¡
Figure¡¡1¡1¡£¡¡Selecting¡¡Visual¡¡Basic¡¡2008¡¡Express¡¡Edition¡¡
Installing¡¡Visual¡¡Basic¡¡Express¡¡
After¡¡you¡¯ve¡¡downloaded¡¡the¡¡setup¡¡file£»¡¡you¡¡can¡¡start¡¡the¡¡Visual¡¡Basic¡¡Express¡¡installation¡£¡¡¡¡
During¡¡this¡¡process£»¡¡all¡¡the¡¡pieces¡¡of¡¡the¡¡IDE¡ªabout¡¡300MB¡ªare¡¡downloaded¡¡and¡¡installed¡£¡¡¡¡
Follow¡¡these¡¡steps£º¡¡
¡¡¡¡¡¡¡¡¡¡1¡£¡¡¡¡On¡¡your¡¡desktop£»¡¡double¡click¡¡the¡¡vbsetup¡£exe¡¡file¡£¡¡Wait¡¡while¡¡the¡¡setup¡¡program¡¡loads¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡all¡¡the¡¡required¡¡ponents¡£¡¡
¡¡¡¡¡¡¡¡¡¡2¡£¡¡¡¡Click¡¡Next¡¡on¡¡the¡¡initial¡¡setup¡¡screen¡£¡¡
¡¡¡¡¡¡¡¡¡¡3¡£¡¡¡¡A¡¡series¡¡of¡¡dialog¡¡boxes¡¡will¡¡appear¡£¡¡Select¡¡the¡¡defaults¡¡and¡¡click¡¡Next¡¡to¡¡continue¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡through¡¡the¡¡setup¡¡program¡£¡¡In¡¡the¡¡final¡¡dialog¡¡box£»¡¡click¡¡Install¡£¡¡¡¡
¡¡¡¡¡¡¡¡¡¡4¡£¡¡¡¡After¡¡all¡¡the¡¡elements¡¡have¡¡been¡¡downloaded¡¡and¡¡installed£»¡¡you¡¡may¡¡need¡¡to¡¡restart¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡your¡¡puter¡£¡¡
¡¡¡¡¡¡¡¡¡¡After¡¡Visual¡¡Basic¡¡Express¡¡is¡¡installed£»¡¡you¡¡can¡¡start¡¡it¡¡by¡¡selecting¡¡it¡¡from¡¡the¡¡Start¡¡menu¡£¡¡
Choosing¡¡the¡¡Application¡¡Type¡¡
With¡¡Visual¡¡Basic¡¡Express¡¡running£»¡¡you¡¯re¡¡ready¡¡to¡¡write¡¡your¡¡first¡¡¡¡application¡£¡¡However£»¡¡¡¡
first¡¡you¡¡need¡¡to¡¡make¡¡a¡¡choice£º¡¡what¡¡type¡¡of¡¡application¡¡will¡¡you¡¡write£¿¡¡Broadly¡¡speaking£»¡¡in¡¡¡¡
£»¡¡you¡¡can¡¡develop¡¡three¡¡main¡¡types¡¡of¡¡programs£º¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Page¡¡26¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡
4¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡CH¡¡AP¡¡T¡¡E¡¡R¡¡¡¡¡¡1¡¡¡¡¡¡¡ö¡¡¡¡¡¡¡¡R¡¡E¡¡A¡¡DY¡¡£»¡¡¡¡¡¡ST¡¡E¡¡A¡¡DY¡¡£»¡¡¡¡¡¡G¡¡O¡¡£¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡o¡¡¡¡A¡¡console¡¡application¡¡is¡¡designed¡¡to¡¡run¡¡at¡¡the¡¡mand¡¡line¡¡with¡¡no¡¡graphical¡¡user¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡interface¡¡£¨GUI£©¡£¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡o¡¡¡¡A¡¡¡¡Windows¡¡application¡¡is¡¡designed¡¡to¡¡run¡¡on¡¡a¡¡user¡¯s¡¡desktop¡¡and¡¡has¡¡a¡¡GUI¡£¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡o¡¡¡¡A¡¡class¡¡library¡¡holds¡¡reusable¡¡functionality¡¡that¡¡can¡¡be¡¡used¡¡by¡¡console¡¡and¡¡Windows¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡applications¡£¡¡It¡¡cannot¡¡be¡¡run¡¡by¡¡itself¡£¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡So¡¡that¡¡you¡¡know¡¡what¡¡each¡¡type¡¡of¡¡program¡¡is¡¡about£»¡¡in¡¡this¡¡chapter£»¡¡you¡¡will¡¡code¡¡all¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡three¡£¡¡They¡¡are¡¡all¡¡variations¡¡of¡¡the¡¡Hello£»¡¡World¡¡example£»¡¡which¡¡displays¡¡the¡¡text¡¡¡°hello£»¡¡world¡±¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡on¡¡the¡¡screen¡£¡¡Hello£»¡¡World¡¡programs¡¡have¡¡been¡¡used¡¡for¡¡decades¡¡to¡¡demonstrate¡¡program
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ming¡¡languages¡£¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Creating¡¡Projects¡¡and¡¡Solutions¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Regardless¡¡of¡¡which¡¡program¡¡type¡¡you¡¡are¡¡going¡¡to¡¡code£»¡¡when¡¡using¡¡the¡¡Visual¡¡Studio¡¡line¡¡of¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡products£»¡¡you¡¡will¡¡create¡¡projects¡¡and¡¡solutions£º¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡o¡¡¡¡A¡¡project¡¡is¡¡a¡¡classification¡¡used¡¡to¡¡describe¡¡a¡¡type¡¡of¡¡¡¡application¡£¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡o¡¡¡¡A¡¡solution¡¡is¡¡a¡¡classification¡¡used¡¡to¡¡describe¡¡multiple¡¡¡¡applications¡¡that¡¡most¡¡likely¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡relate¡¡to¡¡each¡¡other¡£¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Imagine¡¡building¡¡a¡¡car¡£¡¡A¡¡project¡¡coul