程式设计实务使用剖析课件.ppt

上传人(卖家):晟晟文业 文档编号:4414478 上传时间:2022-12-07 格式:PPT 页数:56 大小:1.65MB
下载 相关 举报
程式设计实务使用剖析课件.ppt_第1页
第1页 / 共56页
程式设计实务使用剖析课件.ppt_第2页
第2页 / 共56页
程式设计实务使用剖析课件.ppt_第3页
第3页 / 共56页
程式设计实务使用剖析课件.ppt_第4页
第4页 / 共56页
程式设计实务使用剖析课件.ppt_第5页
第5页 / 共56页
点击查看更多>>
资源描述

1、12Outline Download eVB 程式開發環境簡介 第一個程式 Hello World!小電子鐘 Form Properties Form Methods Form Events 製作程式安裝檔3Download eVB Where:http:/ Download Microsoft eMbedded Visual Tools 4程式開發環境簡介5程式開發環境簡介(Cont.)工作環境6程式開發環境簡介(Cont.)工具箱工具列專案視窗專案視窗屬性視窗屬性視窗表單設計視窗7第一個程式 Hello World!8第一個程式 Hello World!(Cont.)9第一個程式 Hell

2、o World!(Cont.)在 ToolBox 上按 label control ,在 Form 上畫出一個區域 10第一個程式 Hello World!(Cont.)將 Label1 Name 改成 lblWorld,Caption 改成“Hello World!我的 PDA 上的第一個程式”11第一個程式 Hello World!(Cont.)存檔:儲存 project 名稱,*.ebp。儲存 Form 檔案,*.ebf。按 F5 或 執行程式12第一個程式 Hello World!(Cont.)13第一個程式 Hello World!(Cont.)結束程式可以按右上角的 OK,或是 d

3、ebug 工具列的四方形停止按鈕14放入 PDA 執行 將 PDA 放到與 PC 連接的槽上 選擇功能表“Pocket PC”,再執行一次。15小電子鐘16小電子鐘(Cont.)在 Form 上加一個物件 Timer ,並把屬性 Name 值設成 tmrClock,Interval 設為 1000(0 表示 timer 為 disable)。Interval 表示引發 Timer 事件的時間間隔,以千分之一秒為單位。17小電子鐘(Cont.)雙擊 Form 編輯視窗,編輯 tmrClock 物件引發的 Timer 事件程序物件名稱物件名稱事件名稱事件名稱18小電子鐘(Cont.)本來應該是 f

4、rmClock.Cls,但這一部份是在 Form 下執行,所以 Form 的名稱可以省略。19小電子鐘(Cont.)20小電子鐘(Cont.)21Form Properties AutoRedraw BackColor 黑:&H00000000&,白:&H00FFFFFF&Form.BackColor=vbBlack,vbRed BorderStyle vbBSNone:無外框,vbFixedSingle:單線固定式外框,vbSizable:可以變動大小的外框,vbFixedDialog,vbFixedToolWindow,vbSizableToolWindow。22Form Properti

5、es(Cont.)Caption ClipControl:重繪時是要把整個視窗都重繪(TRUE),還是只有把變動的區域重繪。CurrentX,CurrentY DrawMode:設定圖形輸出的外觀。The exact effect of a DrawMode setting depends on the way the color of a line drawn at run time combines with colors already on the screen.vbMergePen:Combination of the pen color and the display color.

6、vbMergeNotPen:Combination of the display color and the inverse of the pen color.23Form Properties(Cont.)DrawStyle:線條輸出的樣式,VbSolid/VbDash DrawWidth(132767 pixel)Enabled:表單是否處於啟動的狀態 FillColor:設定填充於幾何圖形的顏色 FillStyle:picFSSolid/picFSTransparent Font:設定 Form 上的字型,Form.Font.Bold=TRUE24Form Properties(Cont

7、.)FontTransparent:設定文字周邊是否有透明的效果(TRUE:透明)ForeColor:前景顏色 FormResize:設定 Form 是否可以改變大小。Height:設定 Form 高度 KeyPreview:From 對鍵盤事件(KeyDown,KeyUp,KeyPress)的反應。25Form Properties(Cont.)Left:設定 Form 的左界 Top,Width Movable:Form 是否可移動 ScaleHeight:設定表單內部的高度 ScaleLeft ScaleMode:設定物件的座標單位 ScaleTop ScaleWidth ShowOK:

8、設定表單右上角會不會出現一個圓形的 OK 按鈕。26ScaleMode常數值內容VbUser0使用者自訂VbTwips1使用 Twip(每一英吋為 1440 twips,每一公分為 567 twips)VbPoints2使用 point(每一英吋有 72 points)VbPixel3PixelvbCharacters4字元(水平等於 120 twips,垂直 240 twips)VbInches5英吋vbMillimeters6公釐vbCentimeters7公分27Form Properties(Cont.)SIPBehavior:設定 PDA 畫面下方的輸入面版(SIP)何時出現 vbS

9、IPAlways:輸入面版一直出現 vbSIPAutomatic:當使用者按到 Edit 或 Combo box,輸入面版會自動出現 vbSIPUser:完全由使用者自行控制 SIPVisible:輸入面版是否可見,default=FALSE Tag:儲存應用程式額外的資料 Visible:表單是否可見或隱藏28Form Methods 對表單操作(如:清除、顯示、隱藏、畫圓形、畫直線)Cls DrawCircle:object.DrawCircle x,y,radius,color,aspect,aspect 預設值為 1,代表圓形。若 aspect 絕對值大於 1,代表是一水平軸短,垂直軸

10、長的橢圓形。反之當 aspect絕對值小於 1,代表是一水平軸長,垂直軸短的橢圓形。29Form Methods(Cont.)DrawLine:form.DrawLine x1,y1,x2,y2,color,boxfill。boxfill 如果沒有設定的話則是由起點到終點的一直線。若值是 vbLineBox 則畫出一個空的矩形。若值是 vbLineBoxFill 則畫出一個實心的矩形,其中顏色是 color 或是矩形邊線的顏色。Hide Move:移動表單或改變表單的大小。object.Move left,top,width,height。left,top 代表移動後表單的左界和上界。30Fo

11、rm Methods(Cont.)Point:取得表單上某一特定點的色彩數值。object.Point(x,y)PointSet:設定表單上某一特定點的色彩數值。Object.PointSet x,y,color Refresh:將表單上所有的物件重繪 SetScale:重新定義表單上物件的座標系統。object.SetScale x1,y1,x2,y2,x1,y1 是新座標系統的左上角,x2,y2 則是右下角。31Form Methods(Cont.)ScaleX,ScaleY:由原來的 ScaleMode 轉換到其他單位時,轉換之前的水平(或垂直)座標單位至新的水平(或垂直)座標單位。ob

12、ject.ScaleX(value,fromscale,toscale)。value:轉換前測量單位的數值,fromscale:要被轉換的座標系統,toscale:轉換成的座標系統。SetFocus:Move focus to a from or control。Object.SetFocus32Form Methods(Cont.)Show:顯示表單。TextHeight、TextWidth:依照目前 form 的字型設定,取得目前字串的高度(寬度)。object.TextHeight(string)。ZOrder:設定表單在被遮蓋時的先後次序。object.Zorder position。

13、If position is vbBringToFront or omitted,object is positioned at the front of the z-order.If position is vbSendToBack,object is positioned at the back of the z-order.33Form Events Activate:使表單成為使用中的視窗。Private Sub_xxx_Activate(),xxx is a form。A form becomes active when you use the Show or SetFocus me

14、thods in code or when a user initiates an action,such as choosing an object.Click:Private Sub_xxx_Click(),xxx is an object。DblClick:Private Sub_xxx_DblClick(),xxx is an object。34Form Events(Cont.)Deactivate GotFocus:表單物件取得焦點。Private Sub xxx_GotFocus()KeyDown:使用者按下按鍵。Private Sub xxx_KeyDown(keycode,s

15、hift),keycode:Key code,such as vbKeyHome(the HOME key).shift:Integer that corresponds to the state of the SHIFT,CTRL,and ALT keys at the time of the event.35Form Events(Cont.)KeyPress:使用者按下並放開一個 ANSI 字元鍵盤所引發的事件。Private Sub xxx_KeyPress(keyascii),keyascii:Integer that returns a standard numeric ANSI

16、keycode.KeyUP:放開鍵盤。Private Sub xxx_KeyUp(keycode,shift)。Load:載入表單。Private Sub xxx_Load,xxx is a form。For a startup form,the event occurs when an application starts.This event also occurs when a form is first shown or as the result of a reference to an unloaded forms properties or controls.36Form Eve

17、nts(Cont.)LostFocus:表單物件失去焦點,Private Sub xxx_LostFocus(),xxx is an object.MouseDown:按下滑屬鍵,Private Sub object_MouseDown(button,shift,x,y)button:Integer that identifies the chosen button,either the left,middle or the right button.shift:Returns an integer that corresponds to the state of the SHIFT,CTRL

18、,and ALT keys when a user presses or releases the left or right button,as specified in the button parameter.x,y:Returns a number that specifies the current location of the pointer of the mouse device.37Form Events(Cont.)MouseMove:移動滑鼠。Private Sub object_MouseMove(button,shift,x,y)MouseUp:放開滑鼠。Privat

19、e Sub object_MouseUp(button,shift,x,y)OKClick:按下表單上的 OK 鍵。Private Sub form_OnOKClick()Paint:原本被遮蓋的物件,當遮蓋物移走時會觸發此事件重繪視窗。另外視窗大小改變也會觸發此事件。Private Sub object_Paint()38Form Events(Cont.)QueryUnload:This event occurs immediately before a form or application closes.Private Sub Form_QueryUnload(cancel,unloa

20、dmode)。cancel:Integer.Setting this parameter to any value other than 0 stops the form and application from closing.unloadmode:Value that indicates the cause of the QueryUnload event.The unloadmode parameter is always 0.If you use App.End to terminate an application,forms do not execute the QueryUnlo

21、ad and Unload events.39Form Events(Cont.)Resize:This event occurs when a form or PictureBox control is first displayed or when the window state of a form changes.Private Sub form_Resize()Private Sub picturebox_Resize(height,width)。height:New height of the control.width:New width of the control.40For

22、m Events(Cont.)SIPChange:輸入面版的狀態(顯示或不顯示)有改變時,會引發此事件。Private Sub form_SIPChange(Boolean),Boolean:Boolean that returns a display state of the input panel.The SIPChange event occurs when the input panel is displayed or hidden.Returns TRUE if the input panel is displayed,FALSE if the input panel is hidd

23、en.41Form Events(Cont.)Unload:This event occurs when a form is unloading.Private Sub form_Unload(cancel)。cancel:Integer.Setting this parameter to any value other than 0 stops the form and application from closing.If you use App.End to terminate an application,forms do not execute the QueryUnload and

24、 Unload events.42Form Events(Cont.)Terminate:Form 要被結束前所產生的事件。This event occurs when you remove all references to an instance of a Form object from memory.Private Sub form_Terminate()The Terminate event occurs after the Unload event.The Terminate event does not occur if the application terminates ab

25、normally.The Terminate event occurs only when an application closes,after all forms are unloaded.The Terminate event does not support the MsgBox function.43製作程式安裝檔 Step1:在功能表上選擇 File-Make DigitalClock.vb,將程式編譯成.vb44製作程式安裝檔(Cont.)指定編譯好的檔案存放位置45製作程式安裝檔(Cont.)Step 2:Tools-Remote tools-Application Insta

26、ll Wizard46製作程式安裝檔(Cont.)按下一步47製作程式安裝檔(Cont.)指定程式的專案檔位置48製作程式安裝檔(Cont.)指定編譯好的檔案放於何處49製作程式安裝檔(Cont.)指定製作好的安裝檔要放在哪裡50製作程式安裝檔(Cont.)選擇要支援的 CPU 型號51製作程式安裝檔(Cont.)選擇要安裝的控制元件檔案52製作程式安裝檔(Cont.)如果你的程式有用到其他的檔案(E.g.圖檔),在此加入該檔案。53製作程式安裝檔(Cont.)指定安裝程式的目錄、應用程式名稱、應用程式說明及軟體設計公司名稱54製作程式安裝檔(Cont.)55製作程式安裝檔(Cont.)目錄下的檔案56製作程式安裝檔(Cont.)在 App 目錄下是*.vb,其餘則是針對不同的 CPU 產生的程式。安裝程式位於 CD1 目錄下。執行 setup.exe 可以把程式安裝到 PDA 中。

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 办公、行业 > 各类PPT课件(模板)
版权提示 | 免责声明

1,本文(程式设计实务使用剖析课件.ppt)为本站会员(晟晟文业)主动上传,163文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。
2,用户下载本文档,所消耗的文币(积分)将全额增加到上传者的账号。
3, 若此文所含内容侵犯了您的版权或隐私,请立即通知163文库(发送邮件至3464097650@qq.com或直接QQ联系客服),我们立即给予删除!


侵权处理QQ:3464097650--上传资料QQ:3464097650

【声明】本站为“文档C2C交易模式”,即用户上传的文档直接卖给(下载)用户,本站只是网络空间服务平台,本站所有原创文档下载所得归上传人所有,如您发现上传作品侵犯了您的版权,请立刻联系我们并提供证据,我们将在3个工作日内予以改正。


163文库-Www.163Wenku.Com |网站地图|