VISUAL C++ PROGRAMMING: CONCEPTS AND PROJECTS Chapter 1B Introduction (Tutorial)

Slides:



Advertisements
Similar presentations
Introduction to Eclipse. Start Eclipse Click and then click Eclipse from the menu: Or open a shell and type eclipse after the prompt.
Advertisements

Introduction to Visual Basic.NET Uploaded By: M.Sheraz anjum.
CS0004: Introduction to Programming Visual Studio 2010 and Controls.
Visual Basic 2010 How to Program. © by Pearson Education, Inc. All Rights Reserved.2.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
1 Introduction to the Visual Studio.NET IDE Powerpoint slides modified from Deitel & Deitel.
Creating a Console Application with Visual Studio
Microsoft Visual Basic 2010: Reloaded Fourth Edition Chapter One An Introduction to Visual Basic 2010.
Chapter 3 Introduction to Event Handling and Windows Forms Applications.
Microsoft Visual Basic 2005 CHAPTER 8 Using Procedures and Exception Handling.
Visual Basic Fundamental Concepts. Integrated Development Enviroment Generates startup form for new project on which to place controls. Features toolbox.
A First Program Using C#
Visual Basic Chapter 1 Mr. Wangler.
Hello World In C++ and Microsoft Visual C++. Directions to begin a project 1. Go to All Programs 2. Open Visual Studio C++ 3. Click on New Project 4.
Microsoft Visual Basic 2012 Using Procedures and Exception Handling CHAPTER SEVEN.
Microsoft Visual Basic 2005: Reloaded Second Edition
Chapter 1 P. 1 Writing Windows applications with Visual Basic Figure 1.1 The first program works as follows: (These operations can be performed in any.
® Microsoft Access 2010 Tutorial 11 Using and Writing Visual Basic for Applications Code.
Visual Programming Fall 2012 – FUUAST Topic: Development environment.
Introduction to Visual Basic. Quick Links Windows Application Programming Event-Driven Application Becoming familiar with VB Control Objects Saving and.
© 2006 Lawrenceville Press Slide 1 Chapter 3 Visual Basic Interface.
Chapter 3 Introducing Visual Basic.NET. 3.1 Visual Basic.NET Windows Programming -Used to create Windows, Web, and Console applications -Uses predefined.
Teacher: Ms. Olifer MICROSOFT VISUAL STUDIO 2010: PROPERTIES OF WINDOWS FORM OBJECT.
1 1 Lab1 Ismail M. Romi – IT Dept, PPU, Visual Basic 2005 Programming Tour.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Typing Application Introducing Keyboard Events, Menus, Dialogs and the Dictionary.
Chapter 3: Using GUI Objects and the Visual Studio IDE.
Introduction to Visual Basic.NET Programming In Visual Basic.NET.
Visual C++ Programming: Concepts and Projects
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
Program Design and Coding
Microsoft Visual Basic 2012 CHAPTER THREE Program Design and Coding.
Microsoft Visual Basic 2010 CHAPTER THREE Program Design and Coding.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved. 1 5 Completing the Inventory Application Introducing Programming.
Programming with Visual C++: Concepts and Projects Chapter 2B: Reading, Processing and Displaying Data (Tutorial)
Chapter 2 – Introduction to the Visual Studio .NET IDE
1 Creating Windows GUIs with Visual Studio. 2 Creating the Project New Project Visual C++ Projects Windows Forms Application Give the Project a Name and.
Vocabulary in VB So Far. Assignment: Used to change the value of an object at run time Used to change the value of an object at run time.
CSC 157 (Blum)1 Hello World. CSC 157 (Blum)2 Start/Programs/Microsoft Visual Studio.NET 2003/Microsoft Visual Studio.NET 2003.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Second Edition by Tony Gaddis.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Outline 5.1 Test-Driving the Inventory Application.
Chapter 4 Variables and constants. 4.1 Variables -Use of variables is good programming style -easier to modify -easier for a programmer to understand.
COMPUTER PROGRAMMING I 3.02 Apply Properties Associated with the Controls.
Microsoft Visual Basic 2008: Reloaded Third Edition Chapter One An Introduction to Visual Basic 2008.
This is how you invoke the Microsoft Visual Studio 2010 Software. All Programs >> Microsoft Visual Studio 2010.
Copyright (c) 2003 by Prentice Hall Provided By: Qasim Al-ajmi Chapter 2 Introduction to Visual Basic Programming Visual Basic.NET.
Chapter 3 I Need a Tour Guide (Introduction to Visual Basic 2010) Clearly Visual Basic: Programming with Visual Basic nd Edition.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 3 Building an Application in the Visual Basic.NET Environment.
Addison Wesley is an imprint of © 2011 Pearson Addison-Wesley. All rights reserved. Chapter 2 Creating Applications with Visual Basic.
Microsoft Visual Basic 2012 CHAPTER FOUR Variables and Arithmetic Operations.
COMPREHENSIVE Access Tutorial 11 Using and Writing Visual Basic for Applications Code.
Visual Basic.Net. Software to Install Visual Studio 2005 Professional Edition (Requires Windows XP Pro) MSDN Library for Visual Studio 2005 Available.
IE 411/511: Visual Programming for Industrial Applications Lecture Notes #2 Introduction to the Visual Basic Express 2010 Integrated Development Environment.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 2 The Visual Basic.NET Integrated Development Environment.
 2002 Prentice Hall. All rights reserved. 1 Introduction to the Visual Studio.NET IDE Outline Introduction Visual Studio.NET Integrated Development Environment.
Microsoft Visual C# 2010 Fourth Edition Chapter 3 Using GUI Objects and the Visual Studio IDE.
Microsoft Visual Basic 2012: Reloaded Fifth Edition Chapter One An Introduction to Visual Basic 2012.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
ALMAJMA'AH UNIVERSITY College of Science and Humanitarians Studies in Alghat Information Technology Section (211Tal course) 1.
Chapter 2: The Visual Studio .NET Development Environment
Chapter 1: An Introduction to Visual Basic 2015
Chapter Topics 15.1 Graphical User Interfaces
Chapter 2 – Introduction to the Visual Studio .NET IDE
Using Procedures and Exception Handling
Objectives Learn about Function procedures (functions), Sub procedures (subroutines), and modules Review and modify an existing subroutine in an event.
Variables and Arithmetic Operations
Social Media And Global Computing Introduction to Visual Studio
Understanding the Visual IDE
CIS16 Application Development Programming with Visual Basic
Introduction to Visual Basic 2010
Tutorial 11 Using and Writing Visual Basic for Applications Code
Presentation transcript:

VISUAL C++ PROGRAMMING: CONCEPTS AND PROJECTS Chapter 1B Introduction (Tutorial)

Tutorial: Hello World! Visual C++ Programming 2  Problem Analysis  When the user clicks the button “Hello World!” appears in the textbox.  Design  This program has an interface containing One button One textbox

Interface Design Sketch Visual C++ Programming 3

Development and Preliminary Testing Visual C++ Programming 4  Create a new Visual C++ project called “Hello World”  Set up the IDE so that these tabbed windows are available  Solution Explorer  Toolbox  Properties window

Creating a New Project Visual C++ Programming 5

Naming and Saving the Project Visual C++ Programming 6

Setting up the IDE Visual C++ Programming 7

Development and Preliminary Testing (continued) Visual C++ Programming 8  Use the Toolbox to locate controls and place them on the form  Use the Properties window to change the attributes of an object  Run the program by clicking the “Start Debugging” button

Opening the Toolbox Visual C++ Programming 9

Select the Properties Window Visual C++ Programming 10

Toolbox and Properties Window Visual C++ Programming 11

Repositioning the Properties Window Visual C++ Programming 12

Positioning the Solution Explorer Visual C++ Programming 13

Creating textBox1 Visual C++ Programming 14

Creating button1 Visual C++ Programming 15

Using the Properties Window Visual C++ Programming 16

Changing the Text Property of button1 Visual C++ Programming 17

Changing the Text Property of Form1 Visual C++ Programming 18

Running Your Program Visual C++ Programming 19

Getting Rid of an Unnecessary Dialog Box Visual C++ Programming 20

Your Running Program Visual C++ Programming 21

Development and Preliminary Testing (continued) Visual C++ Programming 22  To create a click event handler double click on a button.  The Code Editor window opens and the cursor is positioned within the event handler  When you have finished entering your C++ code run the program and test it

The Code Window Visual C++ Programming 23

The button1_Click() Event Handler Visual C++ Programming 24

Example 1-1 Visual C++ Programming 25

The Statement Completion Dropdown Box Visual C++ Programming 26

Completed button1_Click() Event Handler Code Visual C++ Programming 27

Understanding the Code Visual C++ Programming 28  Windows Forms Designer code  Created automatically  Defines the Form1 class definition  Do not modify it or your program may not work  Keywords  Keywords have a special meaning in Visual C++ and can only be used in their designated context  Keywords are automatically colored blue  Example: this->BackColor  See Appendix B for a list of C++ keywords

Understanding the Code (Continued) Visual C++ Programming 29  Control names and properties  Attributes and methods belonging to a control object are referred to using the operator (->)  Example: textBox1->Text  Strings and delimiters  A string of characters is designated using a pair of quotation marks (double quotes) as delimiters  Example: “Hello World!”  Strings are automatically colored maroon

Example 1-2 Visual C++ Programming 30

Example 1-3 Visual C++ Programming 31

Understanding the Code (Continued) Visual C++ Programming 32  The assignment operator (=)  The value on the right side of the = operator is assigned to the location on the left  Example: textBox1->Text = “Hello World!”;  In this example, the string “Hello World!” is assigned to the Text property of textBox1  Semicolons  Almost every C++ statement is followed by a semicolon (;)  Forgetting to put in a semicolon will prevent your program from compiling

Assignment Statement Visual C++ Programming 33

Testing the Completed Program Visual C++ Programming 34  Your program should  Have one button and one textbox on the form  Display “Hello World!” in the textbox when the button is clicked

Hello World Program Visual C++ Programming 35

Debugging a Program Visual C++ Programming 36  Remove the semicolon (;) from the end of the line you entered earlier  Now run your program and look at the error messages displaying in the Output window  Find the error number and description  Find the line at which the error was detected by the compiler  Fix the error and run your program again

Program Error Dialog Box Visual C++ Programming 37

Locating an Error Visual C++ Programming 38

Locating an Error Line Visual C++ Programming 39

On Your Own Visual C++ Programming 40  Change the textbox font  Add more buttons  Create click event handlers for the new buttons  Change the Text properties of each button  Change the textbox foreground and background colors  Change the background color of the form

Font Property in Properties Window Visual C++ Programming 41

Font Dialog Box Visual C++ Programming 42

Colored Text in textBox1 Visual C++ Programming 43

Color Values Visual C++ Programming 44

Completed Project Visual C++ Programming 45