... PhoneBook(); } Locate the findName_Click method in the Form1.cs source file It is below the findPhone_Click method The findName_Click method is called when the second search button is clicked This ... search for the phone number corresponding to that name in the PhoneBook by using the indexer (notice that Form1 contains a private PhoneBook field called phoneBook); construct a Name object from ... and the class would not compile 4 On the Build menu, click Build Solution Correct any syntax errors and then rebuild if necessary Call the indexers Display the Form1.cs source file in the Code...
Ngày tải lên: 24/12/2013, 09:16
... the class, which can be instantiated into objects A class can inherit another class The inheritance can be virtual, which provides dynamic binding A class can contain an object or have a pointer ... Letters Class Example st CString CString stBuffer; pt CPoint CPoint ptMouse; sz CSize CSize szText; rc CRect CRect rcClip; A pointer to an object has the initial p SyntaxTree* pTree; [ 20 ] Chapter ... painting area of a window The rings can be painted in different colors We increase the painting area by using scroll bars We increase the user-friendliness by introducing menus, toolbars, and accelerators...
Ngày tải lên: 27/06/2014, 12:20
Microsoft Visual C++ Windows Applications by Example phần 2 doc
... second and third of the following lines are completely interchangeable BankAccount accountOriginal(123); BankAccount accountCopy1(accountOriginal); BankAccount accountCopy2 = accountOriginal; In ... m_pFirstCell; }; Stack.cpp #include #include #include #include " \\LinkedList\\Cell.h" "Stack.h" Stack::Stack() :m_pFirstCell(NULL) { // Empty } [ 68 ] Chapter Stack::~Stack() { Cell* ... m_iValue; Link m_pNextLink; }; Cell.cpp #include "Cell.h" Cell::Cell(int iValue, Link pNextLink) :m_iValue(iValue), m_pNextLink(pNextLink) { // Empty } Main.cpp #include #include "Cell.h"...
Ngày tải lên: 12/08/2014, 21:20
Microsoft Visual C++ Windows Applications by Example phần 3 pdf
... we call the function [ 79 ] Object-Oriented Programming in C+ + Main.cpp #include #include using namespace std; #include #include #include "TemplateCell.h" ... CRuntimeClass* pClass); void WriteObject(const CObject* pObject); CRuntimeClass* ReadClass(const CRuntimeClass* pClass); CObject* ReadObject(const CRuntimeClass* pClass); When writing an object, ... LPtoDP(CPoint* pPoints, int iNumberOfPoints = 1) const; IntersectClipRect limits the invalidated area (the part of the client area that is to be repainted) int IntersectClipRect(CRect* pRect);...
Ngày tải lên: 12/08/2014, 21:20
Microsoft Visual C++ Windows Applications by Example phần 4 pptx
... letting it launch the MFC color dialog RingDoc.cpp void CRingDoc::OnColorDialog() { CColorDialog colorDialog(m_nextColor); if (colorDialog.DoModal() == IDOK) { m_nextColor = colorDialog.GetColor(); ... Caret is to be hidden, HideFocus is called, which in turn calls the Win32 API function DestroyCaret Caret.cpp void Caret::SetAndShowCaret(const CRect rcCaret) { m_rcCaret = rcCaret; CClientDC ... Tetris.h, MainFrm.h, MainFrm.cpp, StdAfx.h, StdAfx.cpp, Resource.h, and Tetris.rc #include "stdafx.h" #include "Square.h" #include "Figure.h" #include "ColorGrid.h" #include #include #include #include...
Ngày tải lên: 12/08/2014, 21:20
Microsoft Visual C++ Windows Applications by Example phần 5 pot
... modify CDrawDoc and CDrawView as we develop the application, the rest of the classes will remain unmodified Draw.cpp #include #include #include #include #include #include #include #include #include ... BOOL Click(const CPoint& ptMouse); BOOL DoubleClick(const CPoint& ptMouse); BOOL Inside(const CRect& rcInside) const; void MoveOrModify(const CSize& szDistance); void Move(const CSize& szDistance); ... DoubleClick(const CPoint& ptMouse); BOOL Inside(const CRect& rcInside) const; void MoveOrModify(const CSize& szDistance); void Move(const CSize& szDistance); void Draw(CDC* pDC) const; CRect GetArea() const;...
Ngày tải lên: 12/08/2014, 21:20
Microsoft Visual C++ Windows Applications by Example phần 6 docx
... Regarding CCalcApp, we only add the following include lines Calc.cpp #include "MainFrm.h" #include "ChildFrm.h" #include #include #include #include #include " \\Set.h" " \\List.h" " \\Color.h" ... int cyMargin = (int) (0.05 * rcClip.Height()); rcClip.left rcClip.right rcClip.top rcClip.bottom -= += -= += cxMargin; cxMargin; cyMargin; cyMargin; [ 235 ] The Draw Application CClientDC dc(this); ... \\Caret.h" #include "Reference.h" #include "SyntaxTree.h" #include "Cell.h" #include "CellMatrix.h" #include "TSetMatrix.h" #include "CalcDoc.h" #include "CalcView.h" [ 241 ] The Calc Application...
Ngày tải lên: 12/08/2014, 21:20
Microsoft Visual C++ Windows Applications by Example phần 7 pptx
... bMarked, CDC *pDC) { CRect rcCell(ptTopLeft, CSize(COL_WIDTH, ROW_HEIGHT)); CRect rcMargin(rcCell.left + CELL_MARGIN, rcCell.top + CELL_MARGIN, rcCell.right - CELL_MARGIN, rcCell.bottom - CELL_MARGIN); ... TSetMatrix; class CCalcDoc; [ 270 ] Chapter class Cell { public: Cell(); Cell(const Cell& cell); Cell& operator=(const Cell& cell); void CopyCell(const Cell& cell); void SetCellMatrix(CellMatrix* pCellMatrix) ... m_stInput;} void SetInputText(CString stInput) {m_stInput = stInput;} int MouseToIndex(CPoint ptMouse); CRect IndexToCaret(int iIndex); void Draw(CPoint ptTopLeft, BOOL bEdit, BOOL bMarked, CDC...
Ngày tải lên: 12/08/2014, 21:20
Microsoft Visual C++ Windows Applications by Example phần 8 ppsx
... void CCalcDoc::MakeCellVisible(int iRow, int iCol) { CPoint ptTopLeft(iCol * COL_WIDTH, iRow * ROW_HEIGHT); CRect rcCell(ptTopLeft, CSize(COL_WIDTH, ROW_HEIGHT)); CCalcView* pCalcView = (CCalcView*) ... the caret relative its top left corner void CCalcDoc::UpdateCaret() { switch (m_eCalcStatus) { case CS_MARK: m_caret.HideCaret(); break; case CS_EDIT: CCalcView* pCalcView = (CCalcView*) m_caret.GetView(); ... arithmetic character, or a punctuation mark void CCalcView::OnChar(UINT uChar, UINT /* uRepCnt */, UINT /* uFlags */) { if (isprint(uChar)) { CClientDC dc(this); OnPrepareDC(&dc); m_pCalcDoc->CharDown(uChar,...
Ngày tải lên: 12/08/2014, 21:20
Microsoft Visual C++ Windows Applications by Example phần 9 doc
... pSecondParagraph); Paragraph* Split(int iChar); int PointToChar(CPoint ptMouse); CRect CharToRect(int iChar); CRect GetCaretRect(int iChar); CRect CharToLineRect(int iChar); void Recalculate(CDC* ... not alter the classes Word.cpp #include #include #include #include #include #include #include #include #include #include #include #include #include "stdafx.h" "Word.h" "MainFrm.h" "ChildFrm.h" ... m_rectArray[iChar]; CRect rcCaret(rcChar.left, rcChar.top, rcChar.right, rcChar.bottom); return szUpperLeft + rcCaret; } else { CRect rcChar = m_rectArray[iChar - 1]; CRect rcCaret(rcChar.right, rcChar.top,...
Ngày tải lên: 12/08/2014, 21:20
Microsoft Visual C++ Windows Applications by Example phần 10 ppt
... scroll bars void CWordView::OnSize(UINT /* uType */, int cxClient, int cyClient) { CClientDC dc(this); OnPrepareDC(&dc); CSize szClient(cxClient, cyClient); dc.DPtoLP(&szClient); SCROLLINFO scrollInfo; ... height for each page [ 403 ] The Word Application void CWordView::OnPaint() { CPaintDC dc(this); OnPrepareDC(&dc); CRect rcClient; GetClientRect(&rcClient); dc.DPtoLP(&rcClient); if (rcClient.right ... &scrollInfo); We need to translate the distance into device coordinates before we scroll the window CClientDC dc(this); OnPrepareDC(&dc); dc.LPtoDP(&szDistance); ScrollWindow(0, szDistance.cy);...
Ngày tải lên: 12/08/2014, 21:20
Bài tập 4 – C# Windows Form Application - Basic
... ứng dựng Windows Form c tên DentalPaymentApp theo bư c sau a Tạo project (Ctrl+Shift +N), b Trong c a sổ new project chọn Visual C# - Windows c Phần template chọn Windows Forms Application d ... “Impact, Size = 17”, ForeColor = Blue lblName Label txtName TextBox chkClean CheckBox Text = C o vôi” lblCleanCost Label Text=”$100000” chkWhitening CheckBox Text=”TNy trắng” lblWhiteningCost ... dùng C# Khoa CNTT- Hutech Hình 6: Minh họa c ch kích đúp vào button để tạo event handler - C ch 2: chọn button c n tạo trình xử lý, sau kích tab event c a sổ Properties, kích đúp vào m c Click c a...
Ngày tải lên: 14/09/2013, 10:21
Bài tập 5 – C# Windows Form Application - Basic
... Lập trình Windows dùng C# Khoa CNTT- Hutech Một nhập access code c hai trạng thái: granted denied Tất thông tin truy c p hiển thị khung thông tin bên keypad Nếu access granted ngày, ... TextBox Security Code “*” Created by Nguyen Ha Giang Email: nguyenha.giang@yahoo.com -3- Lập trình Windows dùng C# Khoa CNTT- Hutech Hình 3: Thiết lập thu c tính PasswordChar txtSecurityCode ... gian, group (technician, custodian, scientist) hiển thị khung thông tin Trường hợp access denied ngày, thông tin “Access denied” hiển thị khung bên Ngoài user nhấn số sercurity code hiển thị thông...
Ngày tải lên: 14/09/2013, 10:21
Bài tập 6 – C# Windows Form Application - Advanced
... nguyenha.giang@yahoo.com -2- Lập trình Windows dùng C# Khoa CNTT- Hutech Hình 2: Mô tả control form Hư ng d n: - Trong chương trình sử dụng lớp DataTable để chứa thông tin order, bao gồm c c t: {FoodName} chứa ... sử dụng: - Người ph c vụ chọn tên bàn list ComboBox, sau tùy theo yêu c u gọi client mà người ph c vụ chọn ăn, th c uống thông qua danh m c ăn thể danh sách button Mỗi lần chọn ăn bổ sung thêm ... lần chọn Buger Phô mai Bò số lượng danh m c gọi bàn hiển thị danh sách bên - Kết th c trình gọi ăn người ph c vụ chọn ch c “Order”, thông tin gởi cho đầu bếp… Mô tả control Form E-Order: Created...
Ngày tải lên: 14/09/2013, 10:21
Bài tập 7 – C# Windows Form Application - Advanced
... tin cho combobox: chứa thông tin chuyên ngành: CNPM, MMT, HTTT Trong properties combobox chuyên ngành, chọn thu c tính Items, kích vào Collections xuất hình String Collection Editor, hình cho phép ... Lập trình Windows dùng C# Khoa CNTT- Hutech Ch c Xóa minh họa sau, phương th c bên trình xử lý kiện button “Xóa” 12 Ch c Sửa: Mô tả: cho phép user chọn sinh viên danh sách th c thao t c chỉnh sửa ... Email: nguyenha.giang@yahoo.com -7- Lập trình Windows dùng C# - Khai báo lớp - C c hàm Constructor - C c Property tương ứng cho field - Khoa CNTT- Hutech C c phương th c lớp Sinh viên dựa theo mô tả...
Ngày tải lên: 14/09/2013, 10:22
Pro .NET 2.0 Windows Forms and Custom Controls in C#
... custom control project You’ll then continue to create user controls, which combine other controls into reusable groups (Chapter 10); derived controls, which enhance existing NET control classes (Chapter ... “no-touch” deployment In conjunction with this, organizations were beginning to recognize the aforementioned shortcomings of Web applications in certain scenarios, and started to once again deploy client ... interfaces • How user interfaces are modeled with objects in a Windows Forms application You’ll learn about several key types of NET classes, including controls, forms, components, and applications...
Ngày tải lên: 19/10/2013, 21:15
Tài liệu Apress - Pro WPF in C# 2008 Windows Presentation Foundation with .NET 3.5 pptx
Ngày tải lên: 24/01/2014, 01:20