TAILIEUCHUNG - Visual C++ and MFC Fundamentals programming phần 10

Để khai báo và kết hợp một biến để kiểm soát, phải nhấp vào hộp kết hợp container và nhấn vào Add Variable Trong hộp kết hợp loại, chọn giá trị Trong hộp kết hợp Loại biến, chọn int Tên biến, loại m_ContainerValue Kích Finish Trên hộp thoại, nhấp vào hộp kết hợp hương vị và click Add Variable | Chapter 20 List-Based Controls Visual C and MFC Fundamentals 4. To declare and associate a variable for a control right-click the Container combo box and click Add Variable 5. In the Category combo box select Value 6. In the Variable Type combo box select int 7. In the Variable Name type m_ContainerValue 8. Click Finish 9. On the dialog box right-click the Flavor combo box and click Add Variable 10. In the Category combo box accept the Control selected. In the Variable Name type m_Flavors and press Enter 11. Add the following variables for the other controls all the Value Variables are CString type ID Control Variable Value Variable IDC TOPPING m Topping IDC SCOOPS m Scoops IDC TAX RATE m TaxRate IDC SUB TOTAL m SubTotal IDC TAX AMOUNT m TaxAmount IDC ORDER TOTAL m OrderTotal 12. Save All Combo Box Methods A combo box is based on the CComboBox class. Therefore if you want to dynamically create this control declare a variable or a pointer to CComboBox using its default constructor. To initialize the control call its Create method. Here is an example BOOL CExerciseDlg OnInitDialog CDialog OnInitDialog SetIcon m_hIcon TRUE SetIcon m_hIcon FALSE Set big icon Set small icon 654 FunctionX Inc. Visual C and MFC Fundamentals Chapter 20 List-Based Controls TODO Add extra initialization here CComboBox Majors new CComboBox Majors- Create WS_CHILD WS_VISIBLE WS_VSCRoLl CBS_DROpDoWNLIST CRect 10 50 100 150 this 0x1448 return TRUE return TRUE unless you set the focus to a control After creating the control probably the next action to take consists of creating its items. To add a string to a combo box you can call the CComboBox AddString method that uses the same syntax as the CListBox AddString member function. Here is an example BOOL CExerciseDlg OnInitDialog CDialog OnInitDialog SetIcon m_hIcon TRUE Set big icon SetIcon m_hIcon FALSE Set small icon TODO Add extra initialization here CComboBox Majors new CComboBox Majors- Create WS_CHILD WS_VISIBLE ws_vscroLl .

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.