Compunet Corporation Programming with Visual Studio.NET GUI Week 13 Tariq Aziz and Kevin Jones.

Slides:



Advertisements
Similar presentations
CS0004: Introduction to Programming Visual Studio 2010 and Controls.
Advertisements

© by Pearson Education, Inc. All Rights Reserved.
Chapter 2 –Visual Basic, Controls, and Events
Chapter 1: An Introduction to Visual Basic.NET Programming with Microsoft Visual Basic.NET, Second Edition.
The Microsoft View: Module 1: Getting Started. Copyright Course 2559B, Introduction to Visual Basic®.NET Programming with Microsoft®.NET. Lecture 1 Microsoft.
CA 121 Intro to Programming Tariq Aziz and Kevin Jones GUI Programming in Visual Studio.NET Chapter 1 Tariq Aziz and Kevin Jones.
The Initial Visual Basic Screen
CA 121 Intro to Programming Tariq Aziz and Kevin Jones GUI Programming in Visual Studio.NET Chapter 2 Tariq Aziz and Kevin Jones.
Compunet Corporation Programming with Visual Basic.NET GUI Week # 11 Tariq Ibn Aziz.
1 Introduction to the Visual Studio.NET IDE Powerpoint slides modified from Deitel & Deitel.
CA 121 Intro to Programming Tariq Aziz and Kevin Jones GUI Programming in Visual Studio.NET Chapter 3 Tariq Aziz and Kevin Jones.
Compunet Corporation Programming with Visual Basic.NET GUI Chapter 3 Week 13 Tariq Aziz and Kevin Jones.
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
CS0004: Introduction to Programming Events. Review  Event Procedure  A set of instructions to be executed when a certain event happens.  Many event-driven.
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.
© 2006 ITT Educational Services Inc. Introduction to Computer Programming: Unit 1: Chapter 2: Slide 1 Unit 1 Introduction to Programming Using VB.NET Chapter.
Visual Basic 2008 Express Edition The IDE. Visual Basic 2008 Express The Start Page Recent Projects Open an existing project Create a New Project.
Microsoft Visual Basic 2012 Using Procedures and Exception Handling CHAPTER SEVEN.
Introduction to Graphical User Interfaces. Objectives * Students should understand what a procedural program is. * Students should understand what an.
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.
© 2006 Lawrenceville Press Slide 1 Chapter 3 Visual Basic Interface.
Menus,MonthCalender, DateTimePicker, MDI,Tree View, List View,
1 Κατανεμημένες Διαδικτυακές Εφαρμογές Πολυμέσων Γιάννης Πετράκης.
Multiple Forms, Container Controls, AddHandler This presentation is based on the Forms and ContainerControls VB Projects 1.
Menus,MonthCalender, DateTimePicker, MDI,Tree View, List View,
Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Assignment #1 Advanced Computer Programming.
Clearly Visual Basic: Programming with Visual Basic 2008 Chapter 4 I Need a Tour Guide.
Chapter 3: Using GUI Objects and the Visual Studio IDE.
Visual Basic 2005 CHAPTER 2 Program and Graphical User Interface Design.
Starting Out with Visual Basic.NET 2 nd Edition Chapter 2 Creating Applications With Visual Basic.NET.
Introduction to Visual Basic.NET Chapter 2 Introduction to Controls, Events.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 7 Using Menus, Common Dialogs, Procedures, Functions, and Arrays.
 Application – another name for a program.  Interface – is what appears on the screen when the application is running.  Program Code – is instructions.
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
Introduction to Visual Basic.NET Your First Visual Basic.NET Application.
Program Design and Coding
Microsoft Visual Basic 2012 CHAPTER THREE Program Design and Coding.
Microsoft Visual Basic 2010 CHAPTER THREE Program Design and Coding.
Project Deployment IT [211 CAP] How to convert your project to a full application.
BIL528 – Bilgisayar Programlama II Introduction 1.
Microsoft Visual Basic 2008 CHAPTER TWELVE Cell Phone Applications and Web Services.
Chapter Two Creating a First Project in Visual Basic.
Chapter 2 - VB 2008 by Schneider1 Chapter 2 –Visual Basic, Controls, and Events 2.1 An Introduction to Visual Basic 2.2 Visual Basic Controls 2.3 Visual.
ADO.NET Objects – Data Providers Dr. Ron Eaglin. Requirements Visual Studio 2005 Microsoft SQL Server 2000 or 2005 –Adventure Works Database Installed.
Chapter 2 – Introduction to the Visual Studio .NET IDE
CSC 157 (Blum)1 Hello World. CSC 157 (Blum)2 Start/Programs/Microsoft Visual Studio.NET 2003/Microsoft Visual Studio.NET 2003.
Chapter 3 - VB.NET by Schneider1 Chapter 3 – Fundamentals of Programming in VB.NET Part I VB.NET Controls VB.NET Events.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 4 Working with Variables, Constants, Data Types, and Expressions.
Microsoft Visual Basic 2010 CHAPTER TWO Program and Graphical User Interface Design.
1 Database Design and Development: A Visual Approach © 2006 Prentice Hall Chapter 12 DATABASE DESIGN AND DEVELOPMENT: A VISUAL APPROACH Chapter 12 Accessing.
Microsoft Visual Basic 2008: Reloaded Third Edition Chapter One An Introduction to Visual Basic 2008.
Copyright (c) 2003 by Prentice Hall Provided By: Qasim Al-ajmi Chapter 2 Introduction to Visual Basic Programming Visual Basic.NET.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 3 Building an Application in the Visual Basic.NET Environment.
IE 411/511: Visual Programming for Industrial Applications Lecture Notes #2 Introduction to the Visual Basic Express 2010 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.
Programming with Visual Basic.NET. Quick Links Program Code The Code Window The Event Procedure Assignment Statements Using AutoList Radio Buttons Buttons.
Chapter 2 - VB 2008 by Schneider1 Chapter 2 –Visual Basic, Controls, and Events 2.1 An Introduction to Visual Basic 2.2 Visual Basic Controls 2.3 Visual.
Computer Science Up Down Controls, Decisions and Random Numbers.
ALMAJMA'AH UNIVERSITY College of Science and Humanitarians Studies in Alghat Information Technology Section (211Tal course) 1.
Chapter 3: I Need a Tour Guide (Introduction to Visual Basic 2012)
Chapter 2 – Introduction to the Visual Studio .NET IDE
GUI Programming using Windows Form
Introduction to VB programming
CIS 338: Images on Forms Dr. Ralph D. Westfall May, 2009.
Overview of the IDE Visual Studio .NET is Microsoft’s Integrated Development Environment (IDE) for creating, running and debugging programs (also.
GUI Programming in Visual Studio .NET
Presentation transcript:

Compunet Corporation Programming with Visual Studio.NET GUI Week 13 Tariq Aziz and Kevin Jones

Compunet Corporation Properties of a GUI Object A GUI Object may have many properties. For example, a button object has a name, size, and location. The text property holds the string that is displayed in the button on the form. Suppose we want two buttons on our form: an OK button and a Quit button. After dragging two buttons from the toolbox to our form, we need to set the text property of each button, so that the following is true: Button1.Text = “OK” Button2.Text = “Quit” Notice that when we write code, we access the property of an object using dot notation; the name of the object comes first, then a dot, then the name of the property.

Compunet Corporation Setting GUI Object Properties We set the property of an object at design time using the Properties window. First, select the GUI object on your form (you’ll see selection handles appear around the object). The Properties window displays the properties of the currently selected object in the Windows Forms Design window. Simply scroll through the properties to find the one you want, then click on the value and change it. Note that setting the properties at design time determines the initial value of the properties at run-time. We may also change the values of properties at run-time by executing assignment statements, such as Button1.Text = “Push here”

Compunet Corporation Text Property of Button1 Object The “Text” property of the Button1 object is displayed here in the Properties window.

Compunet Corporation Text Property of Button1 Object Note that the Text property has been changed to “OK”, so Button1 now displays “OK” instead of “Button1”.

Compunet Corporation Lucky Seven program (Ch. 2) The Lucky Seven program from chapter 2 is a simple application that gives you practice in basic GUI programming. The program allows the user to click the Spin button, each time displaying three random numbers between 0 and 9. The user “wins” if any of the three numbers happens to be “7”, and he loses otherwise. First we’ll setup the user interface, then we’ll define the code behind the Spin button.

Compunet Corporation Start a New Visual Basic Project Click here to start a new project.

Compunet Corporation Name Your Visual Basic Project Type the name of your project here. A folder of the same name will be created to store your project files.

Compunet Corporation Starting With an Empty Form… Click on the Button Control in the Toolbox…

Compunet Corporation then click and drag to draw a button object on your form. Draw a Button on Your Form…

Compunet Corporation Here is your new button. Continue like this, adding another button and four labels. Button1…

Compunet Corporation Two Buttons, Four Labels

Compunet Corporation Editing Object Properties Now edit the text properties of each button and label so your form appears as follows…

Compunet Corporation Changed Text Properties…

Compunet Corporation Now Write the Code Double-click on the Spin button to warp to the Button1_Click event procedure, and fill in the code for the Spin button as it appears on page 53 in your book. You’ll need to go back and add the picturebox object to your form, though… Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As _ System.EventArgs) Handles Button1.Click PictureBox1.Visible = False ' hide picture Label1.Text = CStr(Int(Rnd() * 10)) ' pick numbers Label2.Text = CStr(Int(Rnd() * 10)) Label3.Text = CStr(Int(Rnd() * 10)) ' if any caption is 7 display picture and beep If (Label1.Text = "7") Or (Label2.Text = "7") _ Or (Label3.Text = "7") Then PictureBox1.Visible = True Beep() End If End Sub

Compunet Corporation Type the code here… Type the code from page 53 in your book here.

Compunet Corporation Complete the Example from Chapter 2 Once you’ve finished typing all the code from the book, build and run your program as shown on the following slide.

Compunet Corporation Build the Lucky Seven Program To build (or compile) the program, select Build Solution from the Build menu. To run the program, select Start from the Debug menu, or simply click the Start (Play) button on the standard toolbar. Note: You must login as “student” (password = “computer”) to use this feature.

Compunet Corporation Your Program at Run-time!