visual basic畢業(yè)設(shè)計(jì)外文翻譯_第1頁(yè)
已閱讀1頁(yè),還剩10頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、<p>  附件1:外文資料翻譯譯文</p><p>  Visual Basic簡(jiǎn)介</p><p>  什么是Visual Basic</p><p>  Microsoft Visual Basic 5.0是舊的BASIC語(yǔ)言最近的最好的化身,在一個(gè)包里給你一個(gè)完全的Windows應(yīng)用開(kāi)發(fā)系統(tǒng)。Visual Basic (我們常稱(chēng)它VB)能讓你寫(xiě)、編

2、輯,并且測(cè)試Windows應(yīng)用程序。另外,VB有包括你能用來(lái)寫(xiě)并且編譯幫助文件那的工具,ActiveX控制,并且甚至因特網(wǎng)應(yīng)用程序</p><p>  Visual Basic是它本身的一個(gè)Windows應(yīng)用程序。你裝載并且執(zhí)行VB系統(tǒng)就好象你做其它Windows程序。你將使用這個(gè)運(yùn)行的VB程序創(chuàng)造另外的程序。雖然VB是一個(gè)非常地有用的工具,但VB只是一個(gè)程序員(寫(xiě)程序的人)用來(lái)寫(xiě), 測(cè)試,并且運(yùn)行Windows

3、應(yīng)用程序的工具。</p><p>  盡管程序員們經(jīng)??商娼坏厥褂眯g(shù)語(yǔ)程序和應(yīng)用程序,當(dāng)你正在描述一個(gè)Windows程序時(shí)術(shù)語(yǔ)應(yīng)用程序似乎最適合,因?yàn)橐粋€(gè)Windows程序由若干份代表性的文件組成。這些文件以工程形式一起工作。通過(guò)雙擊一個(gè)圖標(biāo)或由以Windows開(kāi)始應(yīng)用程序運(yùn)行啟動(dòng)菜單用戶從Windows加載并且運(yùn)行工程產(chǎn)生最終的程序。</p><p>  過(guò)去的45年與計(jì)算機(jī)硬件一起的編

4、程工具的角色已經(jīng)演變。今天一種程序語(yǔ)言,例如Visual Basic,一些年以前與程序語(yǔ)言的非常不一致。Windows操作系統(tǒng)的視覺(jué)的天性要求比一些年以前是可利用的更先進(jìn)的工具。在windowed環(huán)境以前,一種程序語(yǔ)言是你用來(lái)寫(xiě)程序的一個(gè)簡(jiǎn)單的基于文章工具。今天你需要的不只是一種語(yǔ)言,你需要一種能在windows系統(tǒng)內(nèi)部工作并且能利用所有的繪畫(huà)、多媒體、聯(lián)機(jī)和Windows提供的多處理活動(dòng)開(kāi)發(fā)應(yīng)用軟件的繪圖開(kāi)發(fā)工具。Visual Bas

5、ic是如此的一種工具。超過(guò)一種語(yǔ)言,Visual Basic讓你產(chǎn)生與今天的Windows操作系統(tǒng)的每個(gè)方面互相影響的應(yīng)用程序。如果在過(guò)去你已經(jīng)注意Visual Basic,你將很驚訝今天的Visual Basic系統(tǒng)?,F(xiàn)在VB創(chuàng)造獨(dú)立的運(yùn)行時(shí)刻的一個(gè)真實(shí)的編輯器.EXE文件比先前的VB程序更快速執(zhí)行。VB也包括若干個(gè)提供逐步的對(duì)話框問(wèn)題的奇才,這些對(duì)話框問(wèn)題通過(guò)應(yīng)用程序指導(dǎo)你。VB的開(kāi)發(fā)平臺(tái),一個(gè)叫開(kāi)發(fā)者工作室的發(fā)展環(huán)境,現(xiàn)在支持和先

6、進(jìn)的Visual C++,Visual J++ 編輯器一樣的特征。因此,一旦你學(xué)習(xí)微軟的</p><p><b>  語(yǔ)言</b></p><p>  今天編程語(yǔ)言不再和它們以前一樣。語(yǔ)言自己沒(méi)變得不太重要,而是應(yīng)用軟件的繪畫(huà)接口已經(jīng)變得更重要。</p><p>  一臺(tái)計(jì)算機(jī)不能理解任何人的說(shuō)的語(yǔ)言。一種口語(yǔ),例如意大利或英語(yǔ),簡(jiǎn)單地太全面并

7、且不明確,計(jì)算機(jī)不能理解。因此,我們必須適應(yīng)機(jī)器并且學(xué)習(xí)計(jì)算機(jī)能理解的一種語(yǔ)言。VB的程序語(yǔ)言是相當(dāng)簡(jiǎn)單的并且在最多的部分使用普通的英語(yǔ)詞和短語(yǔ)。然而,語(yǔ)言明確。當(dāng)你用Visual Basic語(yǔ)言寫(xiě)聲明時(shí),在一樣的上下文以內(nèi)聲明從來(lái)沒(méi)有多樣的意思。</p><p><b>  VB編程進(jìn)程</b></p><p>  當(dāng)你想要使用可視化Basic時(shí),你將跟隨這些基本的

8、步驟:</p><p>  開(kāi)始可視化Basic。</p><p>  創(chuàng)造一個(gè)新應(yīng)程序或裝載一個(gè)存在的應(yīng)用程序。當(dāng)你創(chuàng)建一個(gè)新應(yīng)用程序時(shí),你可能想要使用Visual Basic的VB應(yīng)用程序精靈來(lái)寫(xiě)你的程序的初始的外形。用Visual Basic提供的調(diào)試工具測(cè)試你的應(yīng)用程序。調(diào)試的工具幫助你定位并且排除程序錯(cuò)誤(bugs)。不管你盡最大的努力使他們出來(lái),它們都能出現(xiàn)。</p>

9、;<p>  編譯你的程序進(jìn)一個(gè)最終的應(yīng)用程序。</p><p>  停止Visual Basic。</p><p>  分發(fā)應(yīng)用程序到你的用戶。</p><p>  你將很少連續(xù)執(zhí)行所有的這些步驟。6個(gè)步驟不是連續(xù)的步驟。但是你在完成你的應(yīng)用程序前通過(guò)并且回到的階段。</p><p>  開(kāi)始Visual Basic</

10、p><p>  你從Windows啟動(dòng)菜單啟動(dòng)Visual Basic。Visual Basic開(kāi)發(fā)環(huán)境它自身通常出現(xiàn)在叫做Microsoft Visual Basic 5.0的子菜單上,盡管你的可能由于裝置不同而有一些不同的權(quán)力。你將看到在Microsoft Visual Basic 5.0子菜單上列出的程序。當(dāng)你從子菜單選擇Visual Basic5.0asic加載并出現(xiàn)在你的屏幕上。</p>&l

11、t;p>  在大多數(shù)系統(tǒng)上,一旦你開(kāi)始Visual Basic數(shù)字1.1的對(duì)話框出現(xiàn)。對(duì)話框讓你啟動(dòng)VB應(yīng)用程序精靈,編輯存在的VB程序或從你最近已經(jīng)處理的程序列表上選取,取決于你點(diǎn)擊的對(duì)話框制表符。</p><p>  當(dāng)你能看到對(duì)話框的底部,每次你開(kāi)始當(dāng)對(duì)話框的你能實(shí)際上是看,每次你開(kāi)始Viaual Basic你不必看見(jiàn)對(duì)話框。在將來(lái)如果你點(diǎn)擊選項(xiàng)標(biāo)簽,那么不顯示選出這個(gè)對(duì)話框,當(dāng)你開(kāi)始Visual B

12、asic時(shí)VisualBasic將不顯示開(kāi)的對(duì)話框。</p><p>  數(shù)字1.1。當(dāng)你開(kāi)始VB時(shí)新工程對(duì)話框經(jīng)常出現(xiàn)。</p><p>  一旦你關(guān)上對(duì)話框,規(guī)則的可視化Basic屏幕出現(xiàn)。當(dāng)數(shù)字1.2表演,VB打開(kāi)的屏幕能開(kāi)始工作!數(shù)字1.2表演Visual Basic開(kāi)發(fā)環(huán)境,你將快變得密切地熟悉的環(huán)境。從這開(kāi)發(fā)環(huán)境你將創(chuàng)建Windows程序。 數(shù)字1.2。Vb的屏幕看起來(lái)

13、糊涂。</p><p>  盡管屏幕看起來(lái)糊涂,你能充分定制適合你的需要和偏愛(ài)的Visual Basic屏幕將來(lái),你將調(diào)整屏幕的窗戶尺寸和皮膚并且顯示某個(gè)窗戶因此你的Visual Basic屏幕的開(kāi)始狀態(tài)可能與那數(shù)字1.2的非常地不一致。</p><p>  停止Visual Basic</p><p>  你將從Visual Basic退出并且回到Windowsd

14、e的方法與你退出大多數(shù)Windows應(yīng)用程序的方法一樣:選擇文件|出口,點(diǎn)擊Visual Basic的主窗口靠近的按鈕,點(diǎn)擊Alt+F4,或雙擊那出現(xiàn)在的屏幕左上角VB的控制菜單圖標(biāo)。</p><p>  如果在當(dāng)前開(kāi)的工程以內(nèi)你已經(jīng)改變了一個(gè)或更多的文件(記得工程是包含你的應(yīng)用程序文件的集合而成的),Visual Basic給你一個(gè)最后一個(gè)機(jī)會(huì)在退出Windows前保存你的工作。</p><

15、p><b>  掌握發(fā)展環(huán)境</b></p><p>  在你學(xué)習(xí)Visual Basic以前學(xué)習(xí)開(kāi)發(fā)環(huán)境的細(xì)節(jié)是有點(diǎn)象在你學(xué)習(xí)開(kāi)車(chē)以前學(xué)習(xí)一輛汽車(chē)的零件。然而,你花時(shí)間學(xué)習(xí)一些發(fā)展環(huán)境的更基本的原則,你將更好能學(xué)習(xí)Visual Basic。在VB的環(huán)境以內(nèi)你將更舒適并且當(dāng)在發(fā)展環(huán)境隨后涉及的窗口和工具時(shí)將更好的理解一些聯(lián)系的詞。</p><p>  數(shù)字1.3

16、說(shuō)明了Visual Basic開(kāi)發(fā)環(huán)境有許多更重要的屏幕成分的標(biāo)記。你能從菜單和工具條發(fā)現(xiàn),Visual Basic有點(diǎn)像市場(chǎng)上其它的Windows程序。按照在另外的應(yīng)用程序他們做的許多Visual Basic的菜單條命令工作就像它們?cè)谄渌鼞?yīng)用程序,例如Microsoft Word,中做的一樣。例如,你能選擇編輯|剪切和編輯|粘貼來(lái)從一個(gè)地方剪切正文粘貼到另一個(gè)地方。今天,這些同樣的菜單條命令幾乎在市場(chǎng)上的每個(gè)其它的Windows程序上

17、出現(xiàn)。數(shù)字1.3。開(kāi)始知道發(fā)展環(huán)境。</p><p>  標(biāo)準(zhǔn): 菜單條和工具條</p><p>  Visual Basic的菜單條和工具條正如你期待它們的一樣工作。你能點(diǎn)擊或按一個(gè)菜單條選擇的熱鍵(例如, Alt+F顯示文件菜單)可以看見(jiàn)提供命令的項(xiàng)的下菜單選擇的列表,其它的水平菜單,或?qū)υ捒?。許多菜單選擇有快捷鍵(經(jīng)常被叫了的加速器鑰匙)例如Ctrl+S為文件|保存選項(xiàng)。當(dāng)你按一下

18、快捷鍵時(shí),你需要先顯示菜單直接到存取選擇。</p><p>  工具條提供一個(gè)按鈕存取許多普通的菜單命令。而不選擇編輯|粘貼,例如,你能點(diǎn)擊粘貼工具條按鈕。就象今天大多數(shù)的Windows應(yīng)用程序,Visual Basic支持大量工具條。選擇視圖|工具條看可得到的工具條的一張列表。每一個(gè)都普遍的以一個(gè)有名字的檢查標(biāo)記出現(xiàn)。</p><p>  表格窗口:它會(huì)在哪出現(xiàn)</p>&

19、lt;p>  表格窗口是你主要的工作區(qū)域。盡管表格窗口起初相對(duì)于你的屏幕來(lái)說(shuō)是很小,但是表格窗口包含你的應(yīng)用程序的背景。換句話說(shuō),如果你用VB寫(xiě)一個(gè)基于Windows的計(jì)算器,那么這個(gè)計(jì)算器的按鈕都會(huì)存在于表格窗口上,而且當(dāng)某人運(yùn)行這個(gè)計(jì)算器的時(shí)候,這個(gè)計(jì)算器就會(huì)只出現(xiàn)在表格窗口連帶放置在那的組件和連接在那的代碼。</p><p>  提示:在表格窗口里你將不會(huì)看到程序的代碼。表格窗口支持程序的交互式對(duì)象,

20、例如命令按鈕、標(biāo)簽、文本框、滾動(dòng)條和其他的一些控制。這些代碼在別處出現(xiàn),這個(gè)特殊的窗口被稱(chēng)為代碼窗口。這個(gè)代碼窗口并沒(méi)有在1.3節(jié)中出現(xiàn),但是你可以通過(guò)選擇視圖/代碼來(lái)看代碼窗口。一個(gè)代碼窗口要比一個(gè)文本編輯器小,文本編輯器就是你寫(xiě)連接程序的程序說(shuō)明時(shí)所使用的工具。</p><p>  考慮在1.4節(jié)窗口中運(yùn)行的那個(gè)簡(jiǎn)單的程序。這個(gè)窗口顯示一個(gè)簡(jiǎn)單的帶有一系列選擇的對(duì)話框、文本框和命令按鈕。寫(xiě)這個(gè)程序的程序員是通

21、過(guò)打開(kāi)一個(gè)表格窗口,加入一些控制和連接一些組件來(lái)寫(xiě)的。那就是你將要做的不管是你寫(xiě)簡(jiǎn)單的還是復(fù)雜的VB應(yīng)用程序。你將以一個(gè)空的表格窗口并向這個(gè)窗口添加控制例如選擇和命令按鈕開(kāi)始?;蛟S你的程序甚至需要多個(gè)表格窗口。</p><p>  提示:一些程序,例如命令,允許在一個(gè)特殊的叫做MDI(multiple-document interface)的模塊中出現(xiàn)多個(gè)表格窗口,這里你可以在同一個(gè)程序中打開(kāi)多個(gè)數(shù)據(jù)文檔。只需要

22、一個(gè)簡(jiǎn)單的數(shù)據(jù)窗口的程序稱(chēng)為一個(gè)SDI(single-document interface)程序,例如Windows的記事本程序一次只允許用戶打開(kāi)一個(gè)數(shù)據(jù)文檔。SDI程序可能支持多個(gè)表格;然而,這些表格不但支持多個(gè)數(shù)據(jù)文件而且還為額外的對(duì)話框和第二工作屏幕提供擴(kuò)展的支持。</p><p>  源程序是代碼,表格,菜單,圖表和你為形成一個(gè)工程而創(chuàng)建和編輯的幫助文件(也稱(chēng)為源代碼)。</p><p

23、>  部分你創(chuàng)建的程序,例如表格,代碼和你為輸出準(zhǔn)備的圖形,包括源程序。當(dāng)你或者其他的用戶連接或運(yùn)行這個(gè)源程序,VB將程序翻譯成一個(gè)可執(zhí)行的程序。你不能對(duì)一個(gè)可執(zhí)行程序進(jìn)行一個(gè)直接的修改。如果你在運(yùn)行程序的過(guò)程中發(fā)現(xiàn)一些小錯(cuò)誤,你必須修改源程序(在這個(gè)工程中包含多個(gè)文件)并再運(yùn)行和再編譯這個(gè)源程序。</p><p><b>  工具箱提供控制</b></p><p&

24、gt;  工具箱包括你放置在表格窗口中的命令。你將在下一節(jié)課的時(shí)間學(xué)習(xí)到如何在表格窗口里放置工具箱命令。工具箱有用不完的命令;如果你在表格窗口中放置一個(gè)命令按鈕,那么你也要在工具箱中放置同樣的按鈕。這些被稱(chēng)為固有命令因?yàn)閂B的三個(gè)版本都支持這些標(biāo)準(zhǔn)的工具。你可以根據(jù)你的需要加一些額外的控制到工具箱中。一些額外的工具在VB的三個(gè)版本中,但是這些額外的工具并不出現(xiàn)在工具箱窗口中,除非你通過(guò)工程/組件菜單選擇中加入它們。如果你使用專(zhuān)業(yè)或者企業(yè)

25、版本,你將能夠加一些在標(biāo)準(zhǔn)版本中并不出現(xiàn)的額外的控制。</p><p>  表格設(shè)計(jì)窗口放置表格</p><p>  表格設(shè)計(jì)窗口展現(xiàn)最初的位置和在表格窗口顯示出來(lái)的正確的表格的相關(guān)的大小。已經(jīng)學(xué)習(xí)過(guò)的程序是一個(gè)多重表格程序。帶有文本框題目的表格只是若干表格中的一個(gè)。表格設(shè)計(jì)窗口總是顯示在當(dāng)前的表格窗口中表格在哪出現(xiàn)。如果你想讓某個(gè)表格在當(dāng)前位置的不同地方出現(xiàn)的話,那么你可以在表格設(shè)計(jì)窗口

26、內(nèi)將表格移動(dòng)到表格出現(xiàn)的位置當(dāng)用戶運(yùn)行這個(gè)程序時(shí)。</p><p>  提示:注意表格位置指示器,在工具欄按鈕的右邊,當(dāng)你在表格設(shè)計(jì)窗口移動(dòng)表格時(shí),它的位置將會(huì)改變。</p><p><b>  工程資源管理器窗口</b></p><p>  工程資源管理器窗口,經(jīng)常被稱(chēng)為工程窗口,為你提供在應(yīng)用程序中所有文件的樹(shù)狀結(jié)構(gòu)。微軟在版本4和版本5之

27、間的版本中將名字從工程窗口改為工程資源管理器窗口,用來(lái)慶祝在Windows 95和NT中普遍的樹(shù)狀型文件和典型資源管理器之間的類(lèi)同。你可以擴(kuò)展和結(jié)合觀點(diǎn)的分支以獲得多多少少的描述。</p><p><b>  道具窗口</b></p><p>  道具是被一個(gè)命令的描述性信息詳述的。</p><p>  每次當(dāng)你點(diǎn)擊一個(gè)不同的表格窗口工具時(shí),一

28、個(gè)不同的列表將會(huì)在道具窗口中顯示出來(lái)。道具窗口描述關(guān)于某一形式命令的特性(描述性的和功能性的信息)。在VB中很多特性基本上存在每一個(gè)對(duì)象中。</p><p><b>  幫助在你指尖中</b></p><p>  在線圖書(shū)就是關(guān)于VB的電子圖書(shū)適合VB程序員。</p><p>  VB的在線幫助系統(tǒng)是市場(chǎng)上最先進(jìn)的系統(tǒng)之一。當(dāng)你需要幫助做一個(gè)控

29、制,窗口,工具,或者命令時(shí),請(qǐng)按F1。VB分析你所做的并提供幫助。除此之外,VB還提供一個(gè)巨大的幫助資源叫做在線圖書(shū)。當(dāng)你在幫助菜單中選擇了在線圖書(shū)時(shí),VB會(huì)展示關(guān)于VB的一系列樹(shù)狀結(jié)構(gòu)形式的書(shū),這樣你就能找到你所需要的書(shū)籍并閱讀。這個(gè)在線幫助也擴(kuò)展到Internet上。如果你可以連接到Internet,那么你就可以通過(guò)選擇在線幫助/微軟瀏覽到最新的幫助主題。</p><p><b>  總結(jié)</

30、b></p><p>  這段時(shí)間快速的帶你熟悉VB。你或許已經(jīng)比開(kāi)始時(shí)更明白VB了。程序員用VB開(kāi)發(fā)非常先進(jìn)的Windows應(yīng)用程序?,F(xiàn)在你明白了VB的用途和怎樣去打開(kāi)、關(guān)閉VB,你準(zhǔn)備好全心的投入到VB的學(xué)習(xí)中。</p><p>  附件2:外文原文(復(fù)印件)</p><p>  Whats Visual Basic About?</p>&

31、lt;p>  Controls are tools on the Toolbox window that you place on a form to interact with the user and control the program flow.</p><p>  Microsoft Visual Basic 5.0, the latest and greatest incarnation of

32、 the old BASIC language, gives you a complete Windows application development system in one package. Visual Basic (or VB, as we often call it) lets you write, edit, and test Windows applications. In addition, VB includes

33、 tools you can use to write and compile help files, ActiveX controls, and even Internet applications.</p><p>  Visual Basic is itself a Windows application. You load and execute the VB system just as you do

34、other Windows programs. You will use this running VB program to create other programs. VB is just a tool, albeit an extremely powerful tool, that programmers (people who write programs) use to write, test, and run Window

35、s applications.</p><p>  Although programmers often use the terms program and application interchangeably (as will be done throughout this 24-hour course), the term application seems to fit the best when you

36、're describing a Windows program because a Windows program typically consists of several files. These files work together in the form of a project. The project generates the final program that the user loads and runs

37、 from Windows by double-clicking an icon or by starting the application with the Windows Start menu.</p><p>  The role of programming tools has evolved over the past 45 years along with computer hardware. A

38、programming language today, such as Visual Basic, differs greatly from programming languages of just a few years ago. The visual nature of the Windows operating system requires more advanced tools than were available a f

39、ew years ago. Before windowed environments, a programming language was a simple text-based tool with which you wrote programs. Today you need much more than just a language; you need </p><p>  If you've

40、taken a look at Visual Basic in the past, you'll be amazed at today's Visual Basic system. VB now sports a true compiler that creates standalone runtime .EXE files that execute more quickly than previous VB progr

41、ams. VB also includes several wizards that offer step-by-step dialog box questions that guide you through the creation of applications. VB's development platform, a development environment called the Developer Studio

42、, now supports the same features as the advanced Visual C++ an</p><p><b>  Languages</b></p><p>  Programming languages today are not what they used to be. The language itself has no

43、t gotten less important; rather, the graphical interfaces to applications have gotten more important.</p><p>  A computer cannot understand any person's spoken language. A spoken language, such as Italia

44、n or English, is simply too general and ambiguous for computers to understand. Therefore, we must adapt to the machine and learn a language that the computer can understand. VB's programming language is fairly simple

45、 and uses common English words and phrases for the most part. The language is not ambiguous, however. When you write a statement in the Visual Basic language, the statement never has multiple </p><p>  As yo

46、u progress through the next 24 hours, you will learn more and more of the Visual Basic language's vocabulary and syntax (grammar, punctuation, and spelling rules). You will use the VB programming language to embed in

47、structions within applications you create. All the code you write (code is the program's instructions) must work together to instruct the computer. Code is the glue that ties all the graphics, text, and processes tog

48、ether within an application. Code tells a checkbook application</p><p>  The VB Programming Process</p><p>  When you want to use Visual Basic, you'll follow these basic steps:</p>&l

49、t;p>  1. Start Visual Basic.</p><p>  2. Create a new application or load an existing application. When you create a new application, you might want to use Visual Basic's VB Application Wizard to writ

50、e your program's initial shell, as you'll do in the next hour.</p><p>  3. Test your application with the debugging tools Visual Basic supplies. The debugging tools help you locate and eliminate prog

51、ram errors (called bugs) that can appear despite your best efforts to keep them out.4. Compile your program into a final application.5. Quit Visual Basic.6. Distribute the application to your users.</p><p&g

52、t;  Rarely will you perform all these steps sequentially in one sitting. The six steps are not sequential steps, but stages that you go through and return to before completing your application.</p><p>  Star

53、ting Visual Basic</p><p>  You start Visual Basic from the Windows Start menu. The Visual Basic development environment itself usually appears on a submenu called Microsoft Visual Basic 5.0, although yours m

54、ight be called something different due to installation differences. You will see additional programs listed on the Microsoft Visual Basic 5.0 submenu, but when you select Visual Basic 5.0 from the submenu, Visual Basic l

55、oads and appears on your screen.</p><p>  On most systems, Figure 1.1's dialog box appears as soon as you start Visual Basic. The dialog box lets you start the VB Application Wizard, edit an existing VB

56、project, or select from a list of recent projects you've worked on, depending on the dialog box tab you click.</p><p>  As you can see at the bottom of the dialog box, you don't have to see the dialo

57、g box every time you start Visual Basic. If you click the option labeled Don't show this dialog box in the future, Visual Basic will not display the opening dialog box when you start Visual Basic.</p><p>

58、;  Figure 1.1. The New Project dialog box often appears when you start VB.</p><p>  Once you close the dialog box, the regular Visual Basic screen appears. As Figure 1.2 shows, VB's opening screen can ge

59、t busy! Figure 1.2 shows the Visual Basic development environment, the environment with which you will become intimately familiar soon. From this development environment you will create Windows programs. Figure 1.2.

60、VB's screen looks confusing at first. Although the screen can look confusing, you can fully customize the Visual Basic screen to suit your needs and prefere</p><p>  Stopping Visual Basic</p>

61、<p>  You'll exit from Visual Basic and return to Windows the same way you exit most Windows applications: Select File|Exit, click Visual Basic's main window close button, press Alt+F4, or double-click VB&#

62、39;s Control menu icon that appears in the upper-left corner of the screen.</p><p>  If you have made changes to one or more files within the currently open project (remember that a project is the collection

63、 of files that comprise your application), Visual Basic gives you one last chance to save your work before quitting to Windows.</p><p>  Mastering the Development Environment</p><p>  Learning t

64、he ins and outs of the development environment before you learn Visual Basic is somewhat like learning the parts of an automobile before you learn to drive. If, however, you take the time to learn some of the development

65、 environment's more fundamental principles, you will be better able to learn Visual Basic. You then will be more comfortable within VB's environment and will have a better understanding of the related words when

66、subsequent lessons refer to the windows and tools in the d</p><p>  Figure 1.3 shows the Visual Basic development environment with many of the more important screen components labeled. As you can see from th

67、e menu and toolbar, Visual Basic looks somewhat like other Windows programs on the market. Many of Visual Basic's menu bar commands work just as they do in other applications such as Microsoft Word. For example, you

68、can select Edit|Cut and Edit|Paste to cut and paste text from one location to another. These same menu bar commands appear on almost every other </p><p>  Standards: The Menu Bar and Toolbar</p><p

69、>  Visual Basic's menu bar and toolbars work just as you expect them to. You can click or press a menu bar option's hotkey (for example, Alt+F displays the File menu) to see a pull-down list of menu options th

70、at provides either commands, another level of menus, or dialog boxes. Many of the menu options have shortcut keys (often called accelerator keys) such as Ctrl+S for the File|Save option. When you press an accelerator key

71、, you don't first have to display the menu to access the option.</p><p>  The toolbar provides one-button access to many common menu commands. Instead of selecting Edit|Paste, for example, you could clic

72、k the Paste toolbar button. As with most of today's Windows applications, Visual Basic supports a wide range of toolbars. Select View|Toolbars to see a list of available toolbars. Each one that is currently showing w

73、ill appear with a checkmark by its name.</p><p>  The Form Window: Where It All Happens</p><p>  The Form window is your primary work area. Although the Form window first appears small relative

74、to the rest of your screen, the Form window comprises the background of your application. In other words, if you write a Windows-based calculator with Visual Basic, the calculator's buttons all reside on the Form win

75、dow and when someone runs the calculator, the calculator that appears is really just the application's Form window with components placed there and tied together with code.</p><p>  NOTE:You will not see

76、 program code on the Form window. The Form window holds the program's interactive objects, such as command buttons, labels, text boxes, scrollbars, and other controls. The code appears elsewhere in a special window c

77、alled the Code window. The Code window does not appear in Figure 1.3, but you can select View|Code to see the Code window. A Code window is little more than a text editor with which you write the programming statements t

78、hat tie together the application.</p><p>  Consider the sample program running in Figure 1.4's window. The window shows a simple dialog box with a few options, text boxes, and command buttons.The program

79、mer who created Figure 1.4's dialog box did so by opening a Form window, adding some controls (the items on the Form window that interact with the user--sometimes called tools), and tying the components together with

80、 some Visual Basic language code. That's exactly what you will do when writing simple and complex Visual Basic applications.</p><p>  NOTE: Some applications, such as Word, allow for several Form windows

81、 in a special mode called MDI (multiple-document interface) in which you can open multiple data documents within the same application. An application that requires only a single data window is called an SDI (single-docum

82、ent interface) application, such as the Windows Notepad application that lets the user open only one data document at a time. SDI applications might support multiple forms; however, these forms do not hold multi</p>

83、;<p>  Source program is code, forms, menus, graphics, and help files that you create and edit to form the project (also called source code).</p><p>  The parts of the application that you create, suc

84、h as the forms, the code, and the graphics that you prepare for output, comprise the source program. When you or another user compiles or runs the source program, VB translates the program into an executable program. You

85、 cannot make changes directly to an executable program. If you see bugs when you run the program, you must change the source application (which might contain multiple files in the project) and rerun or recompile the sour

86、ce.</p><p>  The Toolbox Supplies Controls</p><p>  The toolbox contains the controls that you place on the Form window. You will learn in the next hour's lesson how to place toolbox control

87、s on the Form window. The toolbox never runs out of controls; if you place a command button on the Form window, another awaits you on the toolbox, ready to be placed also.These are called the intrinsic controls because a

88、ll three editions of VB support these standard tools. You can add additional controls to the toolbox as your needs grow. Some extra tools come</p><p>  The Form Layout Window Places Forms</p><p>

89、;  The Form Layout window displays the initial position and relative size of the current form shown in the Form window.The application being studied is a multiple-form application. The form with the title Text Box Proper

90、ties is just one of several forms. The Form Layout window always shows where the form appears in the current Form window. If you want the form to appear at a different location from the current position, you can move the

91、 form inside the Form Layout window to move the form's appearin</p><p>  TIP: Notice that the form location indicators, to the right of the toolbar buttons, change when you move the form in the Form Layo

92、ut window.</p><p>  The Project Explorer Window</p><p>  The Project Explorer window, often called the Project window, gives you a tree-structured view of all the files in the application. Micro

93、soft changed the formal name from Project window to Project Explorer window between versions 4 and 5 to celebrate the resemblance of the window to the typical Explorer-like tree-structured file views so prevalent in Wind

94、ows 95 and NT. You can expand and collapse branches of the view to get more or less detail.</p><p>  The Properties Window</p><p>  Properties are detailed descriptive information about a contro

95、l. A different list appears in the Properties window every time you click over a different Form window tool. The Properties window describes properties (descriptive and functional information) about the form and its cont

96、rols. Many properties exist for almost every object in Visual Basic.</p><p>  Help Is at Your Fingertips</p><p>  Books Online are electronic books about Visual Basic for the Visual Basic progra

97、mmer. Visual Basic's online help system is one of the most advanced on the market. When you want help with a control, window, tool, or command, press F1. Visual Basic analyzes what you are doing and offers help. In a

98、ddition, Visual Basic supports a tremendous help resource called Books Online. When you select Books Online from the Help menu, Visual Basic displays a tree-structured view of books about Visual Basic tha</p><

99、p><b>  Summary</b></p><p>  This hour quickly introduced you to Visual Basic. Perhaps you already can see that Visual Basic is more than it first appears. Programmers use Visual Basic to creat

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 眾賞文庫(kù)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論