visual c-sharp programming basics
... executed) when that event occurs. As you can see, when we Click the button, the button1_Click function is executed. That function has been automatically written for you when you double‐click the button. Of course, the same function can be ... open the form named “Form1.cs” (“.cs” is from C Sharp). In case you did not know, in C# the code is usually put between curly braces just like in Java and C++. we click the button. Inside it, we will write the code that will add the two values from the text boxes. ... On the right you have your “Solution Explorer”. When you create a new project, you automatically create a new solution. A solution is a collection of multiple projects, let’s say we make an application called “Calculator” (cause this is what we actually do), and “Calculator” is an application project inside the
Ngày tải lên: 28/04/2014, 15:33
Beginning Visual C++® 2005 (P1) potx
... 341Placing friend Function Definitions Inside the Class 356 Trang 25Chapter 9: Class Inheritance and Virtual Functions 473Visibility Specifiers for Classes and Interfaces 531Access Specifiers for Class ... use for accessing data sources in both MFC and Windows Formsapplications MFC applications are relatively coding-intensive compared to Windows Forms applica-tions This is because you create the ... that teachesyou how to create, customize, and use Windows Forms controls in an application You gainpractical experience by building an application incrementally throughout the chapter ❑ Chapter
Ngày tải lên: 06/07/2014, 02:20
Beginning Visual C++® 2005 (P2) docx
... with the extension cppcontainexecutable C++ source code, and the hfiles contain C++ code consisting of definitions that are used by the executable code The icofiles contain icons The files are ... before your code is compiled into object code,and preprocessor directives generally act on your source code in some way before it is compiled Theyall start with the #character I’ll be introducing other ... represent fundamental data in your computer, essentially ical values, which also includes characters because a character is represented by a numerical charactercode You have already seen the keyword
Ngày tải lên: 06/07/2014, 02:20
Beginning Visual C++® 2005 (P3) pptx
... that calculates the price of a carpet to demonstrate output in a CLR console program: // Ex2_13.cpp : main project file. // Calculating the price of a carpet #include “stdafx.h” using namespace ... quotes to the command line. The L that precedes the string indicates that it is a wide-character string where each character occupies two bytes. The Write() function in the Console class is essentially ... Read() function you could read input data character by character and then analyze the charac- ters read and convert the input to a corresponding numeric value. The Console::ReadKey() function returns
Ngày tải lên: 06/07/2014, 02:20
Beginning Visual C++® 2005 (P4) pps
... refer-allocrefer-ated on the CLR herefer-ap, which includes all CLR reference types, cannot be declared at global scope Declaring Tracking Handles You specify a handle for a type by placing the ... ‘gc’ prefix is a cue to the fact that you are allocating memory on the garbage-collected heap and not the native C++ heap where all the housekeeping is down to you collec-The CLR garbage collector ... lucky star is “; int dice = 0; cout << endl << “ Pick a lucky star!” << “ Enter a number between 1 and 6: “; cin >> dice; cout << endl; switch(dice){ case 1: cout
Ngày tải lên: 06/07/2014, 02:20
... 8-bit characters, but the compiler ensures it is converted to awide-character string You can access individual characters in a string by using a subscript just like an array, and the first acter ... http://www.simpopdf.com Trang 20array<wchar_t>^ indicators = gcnew array<wchar_t>(sentence->Length){L’ ‘};int index = 0; // Index of character foundint count = 0; // Count of punctuation characterswhile((index ... countcontains the number of punctua-tion characters that were found, and indicatorswill contain ‘^’characters at the positions in sentencewhere such characters were found.The output is produced
Ngày tải lên: 12/08/2014, 10:21
... Constructor to the CBox class Let’s extend our CBox class to incorporate a constructor // Ex7_ 04. cpp // Using a constructor #include using std::cout; using std::endl; class CBox { public: double m_Length; ... fundamental to C++, and the new keyword class was intro- duced into the language to describe this concept. The keywords struct and class are almost identical in C++, except for the access control ... words classes. These classes might be named CEmployee, or CCowboy, or CCheese, or CChutney, each defined specifically for the kind of problem that you want to solve, complete with the functions
Ngày tải lên: 12/08/2014, 10:21
Beginning Visual C plus plus phần 5 doc
... produces the output shown as follows: CBox constructor calledCBox constructor calledCCandyBox constructor1 calledCBox constructor calledCCandyBox constructor2 calledmyBox occupies 24 bytesmyCandyBox ... // Uncomment this for an errorcout << endl; func-CCandyBox constructor1 called CBox constructor called CCandyBox constructor2 called myCandyBox volume is 1 myToffeeBox volume is 24 CCandyBox ... automatic call of the base class constructorcaused by the declaration of the CCandyBoxobject myCandyBox Notice how the base class constructor is always called before the derived class constructor.
Ngày tải lên: 12/08/2014, 10:21
Beginning Visual C plus plus phần 7 pot
... http://www.simpopdf.com void CSketcherDoc::OnUpdateColorBlue(CCmdUI* pCmdUI) { // Set menu item Checked if the current color is blue pCmdUI->SetCheck(m_Color==BLUE); } void CSketcherDoc::OnUpdateColorGreen(CCmdUI* ... if the current element is a curve pCmdUI->SetCheck(m_Element==CURVE); } void CSketcherDoc::OnUpdateElementCircle(CCmdUI *pCmdUI) { // Set Checked if the current element is a circle pCmdUI->SetCheck(m_Element==CIRCLE); ... pCmdUI) { // Set menu item Checked if the current color is green pCmdUI->SetCheck(m_Color==GREEN); } void CSketcherDoc::OnUpdateColorRed(CCmdUI* pCmdUI) { // Set menu item Checked if the current
Ngày tải lên: 12/08/2014, 10:21
Beginning Visual C plus plus phần 9 pptx
... view.After creating a view object, you define a CCreateContextobject, context ACCreateContextobject is necessary only when you are creating a window for a view that is to be connected to a document ACCreateContextobject ... CRecordView)CCustomerView::CCustomerView(): CRecordView(CCustomerView::IDD), m_pSet(NULL){ }CCustomerSet* CCustomerView::GetRecordset(){ ASSERT(m_pSet != NULL); return m_pSet; }CRecordset* CCustomerView::OnGetRecordset(){ ... nameclass CDBSampleDoc; // Declare the class name// COrderView form view class COrderView : public CRecordView{ DECLARE_DYNCREATE(COrderView)protected: return reinterpret_cast<CDBSampleDoc*>(m_pDocument);
Ngày tải lên: 12/08/2014, 10:21
Beginning Visual C plus plus phần 10 ppt
... has a Controlsproperty that returns areference to an object of type Control::ControlCollectionthat represents the collection of controls in the group box The Control::ControlCollectionclass defines ... the user clickedCancelin the message box, in which case you set the DialogResultproperty for the dialog object to::DialogResult::Cancel,which has the same effect as clicking the Cancelbutton ... DataGridViewColumnCollectionthat you can also index to reference a particular column Rows and columns are indexed from zero The Cellsproperty for aDataGridRowCollectionobject represents a collection containing
Ngày tải lên: 12/08/2014, 10:21
Ivor Horton’s Beginning Visual C++ 2005 phần 2 pot
... have local scope or block scope. An automatic variable is “in scope” from the point at which it is declared until the end of the block containing its declaration. The space that an automatic variable ... like c:\microsoft visual studio\myprojects\Ex2_07\Ex2_07.cpp(29) : error C2065: ‘count2’ : undeclared identifier This is because count2 is out of scope at this point. Positioning Variable Declarations ... 2 4 Create a program that will calculate the aspect ratio of your computer... reference class types beginning in Chapter 4, but because I have introduced global variables for native C++,
Ngày tải lên: 13/08/2014, 18:20
Ivor Horton’s Beginning Visual C++ 2005 phần 3 pptx
... Stringclass constructor A class constructor is a function that will create a class object when it is called You’ll learn more about constructors when you get into defining your own classes Tracking ... Systemnamespace represents a string in C++/CLI(in fact a string consists of Unicode characters To be more precise it represents a string consisting of a sequence of characters of type System::Char You ... indicatorswill contain ‘^’characters at the positions in sentencewhere such characters were found.The output is produced by the statements: Console::WriteLine(L”There are {0} punctuation characters
Ngày tải lên: 13/08/2014, 18:20
Ivor Horton’s Beginning Visual C++ 2005 phần 4 potx
... size of a rectangle and the function EqualRect() to compare two rectangles. MFC also defines a class called CRect, which is the equivalent of a RECT structure. After you understand classes, you ... words classes. These classes might be named CEmployee, or CCowboy, or CCheese, or CChutney, each defined specifically for the kind of problem that you want to solve, complete with the functions ... would be exactly... Let’s extend our CBox class to incorporate a constructor // Ex7_ 04. cpp // Using a constructor #include using std::cout; using std::endl; class CBox { public: double m_Length;
Ngày tải lên: 13/08/2014, 18:20
Ivor Horton’s Beginning Visual C++ 2005 phần 5 pot
... produces the output shown as follows: CBox constructor calledCBox constructor calledCCandyBox constructor1 calledCBox constructor calledCCandyBox constructor2 calledmyBox occupies 24 bytesmyCandyBox ... list In the secondinstance, you are calling the constructor for CBox This causes the specific CBoxconstructor you havechosen to be called before the CCandyBoxconstructor is executed If you build ... the code shown here: Trang 9int numCandies = candyBox/candy;// Calculate candy boxes per cartonint numCboxes = carton/candyBox; // Calculate wasted carton spacedouble space = carton%candyBox; cout
Ngày tải lên: 13/08/2014, 18:20
Ivor Horton’s Beginning Visual C++ 2005 phần 6 pot
... control Detected memory leaks! Dumping objects -> {143} normal block at 0x00355F08, 15 bytes long Data: < > CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD{142} normal block at 0x00355EC8, 15 ... errorsswitch isenabled.The TraceSwitchreference class has two constructors that have the same parameters as the BooleanSwitchclass constructors You can create a TraceSwitchobject like this: TraceSwitch^ ... the Name class #pragma once // Class defining a person’s nameclass Name {public: Name(); // Default constructorName(const char* pFirst, const char* pSecond); // Constructor char* getName(char*
Ngày tải lên: 13/08/2014, 18:20
beginning visual c#
... 905 Hosting 906 WCF Programming 906 The WCF Test Client 914 Defining WCF Service Contracts 917 Data Contracts 918 Service Contracts 918 Operation Contracts 919 Message Contracts 920 Fault Contracts 920 Self-Hosted ... Services 637 A Hotel Travel Agency Application Scenario 638 A Book Distributor Application Scenario 638 Client Application Types 639 Application Architecture 639 Web Services Architecture 640 Calling ... 884 Summary 895 CHAPTER 26: WINDOWS COMMUNICATION FOUNDATION 899 What Is WCF? 900 WCF Concepts 901 WCF Communication Protocols 901 Addresses, Endpoints, and Bindings 902 Contracts 904 Message...
Ngày tải lên: 24/01/2014, 17:57
Ivor horton beginning visual c++ 2008
... 909 The MFC Collection Classes 909 Types of Collection 910 The Type-Safe Collection Classes 911 Collections of Objects 911 The Typed Pointer Collections 920 Using the CList Template Class 923 Drawing ... 605 Function Objects 605 Function Adapters 606 The Range of STL Containers 606 Sequence Containers 607 Creating Vector Containers 608 The Capacity and Size of a Vector Container 611 Accessing ... Template Class 923 Drawing a Curve 924 Defining the CCurve Class 925 Implementing the CCurve Class 927 Exercising the CCurve Class 929 Creating the Sketch Document 929 Using a CTypedPtrList Template...
Ngày tải lên: 19/03/2014, 14:09
visual c# 2010 recipes (apress)
... 07020000002400005253413200040000010001002b4ef 3c2 bbd6478802b64d0dd3f2e 7c6 5ee 6478802b63cb894a782f3a1adbb46d3ee5ec5577e7dccc818937e964cbe99 7c1 207 6c1 9f2d7 ad179f15f7dccca 6c6 b72a Public key token is 2a1d3326445fc02a The public key ... System.Diagnostics; namespace Apress.VisualCSharpRecipes.Chapter01 { class Recipe01_06 { [Conditional("DEBUG")] public static void DumpState() { Visual C# 2010 Recipes: A ... to compile the HelloWorld.cs source file (from recipe 1-1) if the ConsoleUtils class is contained in the ConsoleUtils.dll library, use the command csc /reference:ConsoleUtils.dll HelloWorld.cs....
Ngày tải lên: 24/01/2014, 19:46
Tài liệu Beginning Silverlight 5 in C Sharp 4th Edition docx
... very useful call hierarchy. To open the Call Hierarchy window, simply right-click on any method, property, or constructor and select View Call Hierarchy. An example of the Call Hierarchy window ... version was called Visual Studio 97,” which was most commonly known for Visual Basic 5.0. In 1998, Microsoft released Visual Studio 6.0. That version included Visual Basic 6.0, as well as Microsoft’s ... instances. • Chapter 10, “System Integration and Device Support,” covers how Silverlight applications can support notifications, integrate with legacy COM applications and libraries, access...
Ngày tải lên: 17/02/2014, 23:20
Bạn có muốn tìm thêm với từ khóa: