高等視窗程式設計
DESCRIPTION
高等視窗程式設計. GUI 的使用 (Dialog Base). 游子宜. 開啟新的 MFC 專案. Step1 :新增 MFC 專案. Step2 :歡迎畫面. Step3 :選取應用程式類型. Step4 :設定進階功能. Step5 :完成專案初始化. 對話盒控制項的種類. Button Static Text Edit Box. Button 的介紹. Step1 :選 取 button 工具. Button 的介紹 ( 續 ). Step2 :調整 button 的屬性. Button 的介紹 ( 續 ). - PowerPoint PPT PresentationTRANSCRIPT
1
高等視窗程式設計GUI的使用 (Dialog Base) 游子宜
2
開啟新的 MFC專案
3
Step1:新增 MFC專案
4
Step2:歡迎畫面
5
Step3:選取應用程式類型
6
Step4:設定進階功能
7
Step5:完成專案初始化
8
對話盒控制項的種類 Button Static Text Edit Box
9
Button的介紹 Step1:選取 button工具
10
Button的介紹 ( 續 )
Step2:調整 button的屬性
11
Button的介紹 ( 續 )
Step3:調整 button的屬性 ( 續 )
12
Button的介紹 ( 續 )
Step4:對 button的事件下指令
13
Button的介紹 ( 續 )
Step5:成功建置 button
14
Static Text的介紹 Step1:選取 static text工具
15
Static Text的介紹 ( 續 )
Step2:調整 static text的屬性
16
Static Text的介紹 ( 續 )
Step3:調整 static text的屬性( 續 )
17
Static Text的介紹 ( 續 )
Step4 : static text無事件動作
18
Static Text的介紹 ( 續 )
Step5:成功建置 static text
19
Edit Box的介紹 Step1:選取 edit box工具
20
Edit Box的介紹 ( 續 )
Step2:調整 edit box的屬性
21
Edit Box的介紹 ( 續 )
Step3:調整 edit box的屬性 ( 續 )
22
Edit Box的介紹 ( 續 )
Step4:對 edit box的事件下指令
23
Edit Box的介紹 ( 續 )
Step5:成功建置 edit box
24
What is DDX & DDV ?
由 MFC所提供,用於在對話盒與對話盒物件間進行: 資料交換 (Data Exchange) :
將 user設定於對話盒中控制項中的資料,與程式所對應的對話盒物件之屬性,進行資料的交換。
資料檢查 (Data Vaildation) :檢查由 user輸入對話盒中傳入的資料是否正確,若違反檢查規則,則自動跳出警告方塊。
25
What is DDX & DDV ? (續 )
需使用 DDX/DDV機制的控制項: Static Text Edit Box
不需使用 DDX/DDV機制的控制項: Button
26
以計算機程式範例為例
27
Step6:建立對話盒使用資源
28
Step7:建立對話盒的 DDX/DDV機制
29
Step8:建立對話盒的 DDX/DDV機制( 續 )
30
Step9:建立 [ 清除 ] 按鈕的回應函數
31
Step10:過載 OnCommand函數
32
Step11:結果畫面