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.

Slides:



Advertisements
Similar presentations
Introduction to Visual Basic.NET Uploaded By: M.Sheraz anjum.
Advertisements

Microsoft Visual Basic 2012 CHAPTER TEN Incorporating Databases with ADO.NET.
1 Introduction to the Visual Studio.NET IDE Powerpoint slides modified from Deitel & Deitel.
Office 2003 Post-Advanced Concepts and Techniques M i c r o s o f t Word Project 8 Working with Macros and Visual Basic for Applications (VBA)
Chapter 2 –Visual Basic, Controls, and Events
2. Introduction to the Visual Studio.NET IDE 2. Introduction to the Visual Studio.NET IDE Ch2 – Deitel’s Book.
Microsoft Visual Basic 2012 CHAPTER TWO Program and Graphical User Interface Design.
Microsoft Visual Basic 2005 CHAPTER 8 Using Procedures and Exception Handling.
Microsoft Visual Basic 2005 CHAPTER 12 Cell Phone Applications and Web Services.
Microsoft Visual Basic 2012 CHAPTER TWELVE (ENRICHMENT CHAPTER) Windows Store Apps.
Visual Basic 2008 Express Edition The IDE. Visual Basic 2008 Express The Start Page Recent Projects Open an existing project Create a New Project.
Visual Basic Chapter 1 Mr. Wangler.
05/09/ Introducing Visual Basic Sequence Programming.
Microsoft Visual Basic 2012 Using Procedures and Exception Handling CHAPTER SEVEN.
Introduction to Visual Basic. Quick Links Windows Application Programming Event-Driven Application Becoming familiar with VB Control Objects Saving and.
IE 411/511: Visual Programming for Industrial Applications
VISUAL C++ PROGRAMMING: CONCEPTS AND PROJECTS Chapter 1B Introduction (Tutorial)
Chapter 3 Introducing Visual Basic.NET. 3.1 Visual Basic.NET Windows Programming -Used to create Windows, Web, and Console applications -Uses predefined.
Chapter 3: Using GUI Objects and the Visual Studio IDE.
A First Look At Microsoft Visual Basic Lesson 1. What is Microsoft Visual Basic? Microsoft Visual Basic is a software development tool, which means it.
Visual Basic 2005 CHAPTER 2 Program and Graphical User Interface Design.
© Paradigm Publishing Inc. MICROSOFT WINDOWS XP MAINTAINING FILES AND CUSTOMIZING WINDOWS Section 2.
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.
Microsoft Visual Basic 2005 CHAPTER 4 Variables and Arithmetic Operations.
RIGHT Mouse Button Formatting Cut Copy Paste Save LEFT Mouse Button MAIN BUTTON Single clicks Double clicks Drag Highlight.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 8 Debugging, Creating Executable Files, and Distributing a Windows Application.
Controls. Adding Controls to Form -You can pick controls from the toolbox. -To add the controls from Toolbox to the Form You have be in design view. -To.
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 230 (Blum)1 Visual Basic 2005 Hello World Fall 2005 T. Blum.
CSC 157 (Blum)1 Hello World. CSC 157 (Blum)2 Start/Programs/Microsoft Visual Studio.NET 2003/Microsoft Visual Studio.NET 2003.
Microsoft Visual Basic 2010 CHAPTER TWO Program and Graphical User Interface Design.
Learning PowerPoint Presenting your ideas as a slide show… …on the computer!
1 Visual Basic Part I - A tool for customizing your program Principles of GIS
This is how you invoke the Microsoft Visual Studio 2010 Software. All Programs >> Microsoft Visual Studio 2010.
BBT 10 Visual Basic 03 Enrichment. Tip Before creating any files for your project, first create a new folder Save all of your files in the folder Pieces.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 3 Building an Application in the Visual Basic.NET Environment.
COMPUTER PROGRAMMING I 3.01 Apply Controls Associated With Visual Studio Form.
CSC 230 (Blum)1 Visual Basic 2005 Hello World Fall 2005 T. Blum.
Microsoft Visual Basic 2012 CHAPTER FOUR Variables and Arithmetic Operations.
IE 411/511: Visual Programming for Industrial Applications Lecture Notes #2 Introduction to the Visual Basic Express 2010 Integrated Development Environment.
COMPUTER PROGRAMMING I 3.01 Apply Controls Associated With Visual Studio Form.
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.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
 You won’t write a single line of program code.  Instead, you’ll use visual programming techniques.  Visual Studio processes your actions (such as mouse.
Visual Basic.NET Windows Programming
Visual Studio 2010 Hello World CSC 230.
Chapter 2: The Visual Studio .NET Development Environment
ASP.NET Web Controls.
Chapter 1: An Introduction to Visual Basic 2015
Chapter 2 – Introduction to the Visual Studio .NET IDE
3.01 Apply Controls Associated With Visual Studio Form
Incorporating Databases with ADO.NET
Program and Graphical User Interface Design
1. Introduction to Visual Basic
3.01 Apply Controls Associated With Visual Studio Form
Using Procedures and Exception Handling
Program and Graphical User Interface Design
Incorporating Databases with ADO.NET
Variables and Arithmetic Operations
Visual Studio 2010 Hello World CSC 230.
Items, Group Boxes, Check Boxes & Radio Buttons
Overview of the IDE Visual Studio .NET is Microsoft’s Integrated Development Environment (IDE) for creating, running and debugging programs (also.
Introduction to Visual Basic 2010
Presentation transcript:

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. Click CLR 5. Click Windows Form Application 6. Type in file name: Hello World! 7. Location: desktop 8. Click OK

Directions to set up IDE We are going to dock three windows on the right side of the screen. 1.Under the view menu, click on toolbox, drag to the right side of the screen, and click the stick pin to lock it on your screen. 2. Under the view menu, click on other windows, click on properties window. Drag to right window.

3. Now to the same for the solutions explorer, which can also be found under the view menu in other windows.

Solution Explorer Displays the structure of your program Shows that it is made of a number of files and folders These must be kept together. Formal1.h file will contain your code Other files support the way the program works

Use the Toolbox to add a control: a textbox In toolbox, scroll down until you get to TextBox, double click. This will create a textbox in the upper left corner of form1, called textbox1 Small white squares around the box indicate that it is highlighted or the selected object. Move the textbox to the middle of form1.

Use the Toolbox to add a control: a Button In toolbox, scroll down until you get to Button, double click. This will create a button, called button1, which is likely located over your textbox. Move the button below your textbox. Remember: the currently highlighted or active object’s information is in the property window

Using the properties window The attributes of a control are known as its properties. 1.Make sure the button1 is highlighted (active), then go to the properties window. You will see the properties for that button. 2.Scroll to Text, delete button1 and type in “Click for a Message”. Then press the enter key. 3.You should see Click for a Message on the button in the form now.

Can also change the properties of the form itself Click on the form anywhere except in the textbox or button. In the property window, scroll to Text, change it to Hello World! Press enter key. It’s usually a good idea to change the name of Form1 to the name of the program

Saving your work Click file menu Click Save All ALWAYS USE SAVE ALL! Never save as

How to Run the Program Click the Start Debugging Button (green triangle) on the toolbar. If you see a dialog box, click the box labeled Do not show this dialog again. Then click yes. Click the box on the program that says Click for message. What happens? _____________

Coding an Event Handler Double click the button on the form. This opens the Code Editor Window, also called the Code Window This is the code that underlies the form. The code is labeled Form1.h while the design window is called Form1.h [Design] DO NOT CHANGE THE CODE

Coding Event Continued The cursor is located at the end of the code prior to the closing of the curly bracket. Hit the enter key to go to a new line textBox1->Text = “Hello World!”; Save you program using SAVE ALL Run the program, using the green button.

Keywords Colored blue Predefined meanings in C++, can’t be used for anything else Examples: this, false, private This: used whenever a form wants to refer to itself Text or strings are colored blue

Control Names and Properties Form1, textbox1, button1 All controls have properties textBox1 -> Text, is used to identify the text property for textBox1 -> is the pointer membership operator. It indicates (points to) a property belonging to an object. Can be used for any properties

More control names and properties textBox1 ->BackColor, background color property For form1 use this ->BackColor

Strings Use quotation marks, to deliminate strings

= Assignment operator Makes something equal to something else textBox1-> Text = “Hello World!”;

Semicolons; Most C++ statements end in a semicolon Your code will not execute properly without the semicolon

You will now complete 6 Tasks When you complete a task, you must call me over to see the finished program to get credit. Once I have checked it off, you can move to the next task.

Task 1: Change the Textbox Font The Font property controls the size and appears of the message. To change the Font you will need to click on the Elllipsis(…) to get the font dialog box. You may need to resize the box.

Task 2: Add more Buttons Add three more buttons

Task 3: Create click Event Handlers for Each buttton Have the buttons display the following messages, one for each button: Hello Green World! Hello Red World! Hello Yellow World! Hello Blue World!

Task 4: Change the Text Properties of each Button Click for a green message Click for a Red message Etc.

Task 5: Change the textbox text color and background color textBox1 -> ForeColor = Color::Red; textBox1-> BackColor

Task 6: Change the Background Color of the Form Change the BackColor property of the form Use the keyword this All tasks must be completed by the end of class on Thursday.