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.

Slides:



Advertisements
Similar presentations
JustinMind: Dynamic Panels
Advertisements

Microsoft Expression Web-Illustrated Unit J: Creating Forms.
Using Macros and Visual Basic for Applications (VBA) with Excel
CHAPTER TWO Creating Simple Visual Basic.NET Windows Applications.
Visual Basic 2010 How to Program. © by Pearson Education, Inc. All Rights Reserved.2.
Visual Basic 2010 How to Program Reference: Instructor: Maysoon Bin Duwais slides Visual Basic 2010 how to program by Deitel © by Pearson Education,
Chapter 1: An Introduction to Visual Basic.NET Programming with Microsoft Visual Basic.NET, Second Edition.
C# Programming: From Problem Analysis to Program Design1 Programming Based on Events C# Programming: From Problem Analysis to Program Design 3 rd Edition.
CA 121 Intro to Programming Tariq Aziz and Kevin Jones GUI Programming in Visual Studio.NET Chapter 1 Tariq Aziz and Kevin Jones.
Graphical User Interface (GUI) A GUI allows user to interact with a program visually. GUIs are built from GUI components. A GUI component is an object.
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.
Fundamentals of Programming in Visual Basic 3.1 Visual basic Objects Visual Basic programs display a Windows style screen (called a form) with boxes into.
Access Tutorial 10 Automating Tasks with Macros
Slide 1 Chapter 2 Visual Basic Interface. Slide 2 Chapter 2 Windows GUI  A GUI is a graphical user interface.  The interface is what appears on the.
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.
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.
Programming with Microsoft Visual Basic 2012 Chapter 12: Web Applications.
Introduction to Graphical User Interfaces. Objectives * Students should understand what a procedural program is. * Students should understand what an.
Department of Mechanical Engineering, LSUSession VII MATLAB Tutorials Session VIII Graphical User Interface using MATLAB Rajeev Madazhy
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
© 2006 Lawrenceville Press Slide 1 Chapter 3 Visual Basic Interface.
Chapter 12: Using Controls. Examining the IDE’s Automatically Generated Code A new Windows Forms project has been started and given the name FormWithALabelAndAButton.
Chapter 2 More Controls Programming in C#. NET © 2003 by The McGraw-Hill Companies, Inc. All rights reserved.
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.
Chapter 8: Writing Graphical User Interfaces Visual Basic.NET Programming: From Problem Analysis to Program Design.
 Application – another name for a program.  Interface – is what appears on the screen when the application is running.  Program Code – is instructions.
Introduction It is developed to create software applications. It is a tool for developers of any program that uses both basic and expert settings. It.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved. 1 3 Welcome Application Introduction to Visual Programming.
Visual Basic.NET BASICS Lesson 1 A First Look at Microsoft Visual Basic.NET.
Visual C# 2012 How to Program © by Pearson Education, Inc. All Rights Reserved.
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
Microsoft Visual Basic 2005 BASICS Lesson 1 A First Look at Microsoft Visual Basic.
Visual C# 2012 How to Program © by Pearson Education, Inc. All Rights Reserved.
CSC 157 (Blum)1 Hello World. CSC 157 (Blum)2 Start/Programs/Microsoft Visual Studio.NET 2003/Microsoft Visual Studio.NET 2003.
Visual Basic Programming Introduction VB is one of the High level language VB has evolved from the BASIC language. BASIC stands for Beginners All-purpose.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Second Edition by Tony Gaddis.
 2002 Prentice Hall. All rights reserved. 1 Chapter 2 – Introduction to the Visual Studio.NET IDE Outline 2.1Introduction 2.2Visual Studio.NET Integrated.
Chapter 2 More Controls Programming in C#. NET Objectives Use text boxes, group boxes, check boxes, radio buttons, and picture boxes effectively.
COMPUTER PROGRAMMING I 3.01 Apply Controls Associated With Visual Studio Form.
Customizing Menus and Toolbars CHAPTER 12 Customizing Menus and Toolbars.
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.
 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.
Hamilton Software Products The Measure of Excellence Customized dialog.
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.
Dive Into® Visual Basic 2010 Express
Chapter 1: An Introduction to Visual Basic .NET
Visual Basic.NET Windows Programming
Chapter 2: The Visual Studio .NET Development Environment
Chapter Topics 15.1 Graphical User Interfaces
Chapter 8: Writing Graphical User Interfaces
Chapter 2 – Introduction to the Visual Studio .NET IDE
3.01 Apply Controls Associated With Visual Studio Form
1. Introduction to Visual Basic
3.01 Apply Controls Associated With Visual Studio Form
Chapter 1: An Introduction to Visual Basic 2015
Chapter 2 Visual Basic Interface
Variables and Arithmetic Operations
Chapter 2 – Introduction to the Visual Studio .NET IDE
Chapter 15: GUI Applications & Event-Driven Programming
Overview of the IDE Visual Studio .NET is Microsoft’s Integrated Development Environment (IDE) for creating, running and debugging programs (also.
Presentation transcript:

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 Location Confirm

3 The Form Designer Window When you start a new Windows Form Application, you will be immediately taken to the designer window This is where you modify the appearance, properties, and components of your form Compile and run the project at any time to preview your form

4 Modifying Form Properties A Windows Form has Many Properties Each Property Changes Your Form In Some Way To Access the Properties:  Right-Click your form  Select Properties  The Property Viewer Will Appear on Screen  Click on a property to view possible values and an explanation of what this property does

5 Commonly Used Properties Appearance Properties  BackColor, ForeColor  FormBorderStyle – Resizable or Not  Font  Text – Title of your Form Layout Properties  AutoScale  Size and StartPosition Windows Style Properties  Icon  MinimizeBox, MaximizeBox  Opacity – 100 for solid, 0 for invisible

6 Modifying Form Appearance Most appearance changes are done through properties Others are made in the design window Mostly by dragging, dropping, and resizing

7 Adding Components to Your Form You must use the “Toolbox” to add graphical or control components to your form (labels, buttons, etc…) Go to “View -> Toolbox” or mouse over the toolbox tab on the right This opens the toolbox and allows you to choose components Drag components onto your for design to add them

8 Customizing Components Each component you add will be a default component You must position and size each component as you please Also, components have properties you can (or must) modify to customize them

9 Common Simple Components Labels and Link Labels  Allow you to name items or provide linked information. Buttons  Allow the user to perform actions Text Boxes  Allow the user to input information

10 Common Simple Components Menu Items  Allow the user to interact with the form menu Check Boxes and Radio Buttons  Allow the user to select or choose controls Grouping Boxes  Help clearly mark groupings of components

11 Editing the Form’s C++ Code All of the code to display your form is written for you! The automatic code cannot handle user- generated events YOU must write the event handling code!

12 More about events… When running, the form is in an infinite “event loop” until an exit command is given In the event loops, user interaction with form components is detected Each interactive form component should have an event handling function  What do I do when the user clicks me?

13 Event Handling Function Double click the component to which you want to add a click event handler The click event handling function will be added and your editor will place your cursor at that function You must fill in the body of this function with C++ code to handle the click event

14 Making Your Form Interactive Certain form components allow the user to interact with the form Text Boxes allow users to type input to the form or get feedback from the form Radio Buttons and Check Boxes allow the user to select from options Your event handlers must collect information from these components in order to perform

15 Accessing Components in Event Handlers To access form components and/or their properties you must use the “arrow” or “dereference” operator The arrow operator follows a path of already made pointers and names to the information you desire

16 The Arrow Operator Examples:  this->textBox1->Text Gives the value of the Text property in textBox1 on this form (String data type)  this->radioButton1->Checked Gives the value of the Checked property in radioButton1 on this form (boolean data type)

17 An Example Create a form having two text boxes and one button The first text box should be interactive for the user to enter data and have a default value of “0” The second should be “ReadOnly” to display the results The button should be labeled “Square It!”

18 Example Continued… When the button is pressed, the number entered in the first text box should be squared and the answer displayed in the second text box Note that text boxes can only deal with String data  How do we convert to and from numerical data to do the calculations?

19 A Look at the Button Event Handler private: System::Void button1_Click(System::Object * sender, System::EventArgs * e) { double operand = Convert::ToDouble(this->textBox1->Text); double result = operand * operand; this->textBox2->Text = Convert::ToString(result); } We use the Convert interface to convert between data types Note we have accessed a property in one form component and set a property of another Perform more complex operations by simply extending your event handling code as needed