Fundamentals of GUI Programming. Objectives: At the end of the session, you should be able to: describe the guidelines that are used for creating user-friendly.

Slides:



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

The Web Warrior Guide to Web Design Technologies
Creating an OOED Application
A graphical user interface (GUI) is a pictorial interface to a program. A good GUI can make programs easier to use by providing them with a consistent.
Fundamentals of Programming in Visual Basic
Computer Science: A Structured Programming Approach Using C1 Objectives ❏ To understand the structure of a C-language program. ❏ To write your first C.
VB Code Statements 3 types of VB statement The Remark statement, known as comments, are used for project documentation only Begin with an apostrophe Not.
To type the VB code behind the command button (named cmdPush), Double-Click on the Push Me (caption) command button As a result the Visual Basic Code Window.
 Visual Basic is an object-oriented language used to write application programs that run in Windows or on the Internet using a graphical user interface.
Getting Started Example ICS2O curriculum
Saving and Loading Simple Text Files A sequential file stores characters one after the other like songs on a cassette tape. New characters are added to.
Visual Basic Fundamental Concepts. Integrated Development Enviroment Generates startup form for new project on which to place controls. Features toolbox.
Microsoft® Small Basic
Variables and Constants
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.
Tutorial 11 Using and Writing Visual Basic for Applications Code
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.
1 Visual Basic for Applications (VBA) for Excel Prof. Yitzchak Rosenthal.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Interest Calculator Application Introducing the For...Next Repetition Statements.
Introduction to Visual Basic. Quick Links Windows Application Programming Event-Driven Application Becoming familiar with VB Control Objects Saving and.
VISUAL C++ PROGRAMMING: CONCEPTS AND PROJECTS Chapter 1B Introduction (Tutorial)
Chapter 3: Using GUI Objects and the Visual Studio IDE.
Chapter 3 – Fundamentals of Programming in VB.NET VB.NET Controls VB.NET Events Numbers Strings Input and Output.
Introduction to Visual Basic.NET Chapter 2 Introduction to Controls, Events.
TUTORIAL 10: PROGRAMMING WITH JAVASCRIPT Session 2: What is JavaScript?
Basic Controls & Properties Chapter 2. Overview u VB-IDE u Basic Controls  Command Button  Label  Text Box  Picture Box u Program Editor  Setting.
Representing Data: Constants and Variables CHAPTER THREE Matakuliah: T0063 – Pemrograman Visual Tahun: 2009.
Tutorial 11 Five windows included in the Visual Basic Startup Screen Main Form Toolbox Project Explorer (Project) Properties.
Chapter 4 Variables and constants. 4.1 Variables -Use of variables is good programming style -easier to modify -easier for a programmer to understand.
CHAPTER 4: CONTROL STRUCTURES - SEQUENCING 10/14/2014 PROBLEM SOLVING & ALGORITHM (DCT 1123)
Visual Basic.net Textbox & Label Controls. Textbox Naming convention (txt) Primary use (user input) Can except numeric and character values.
Working with the VB IDE. Running a Program u Clicking the”start” tool begins the program u The “break” tool pauses a program in mid-execution u The “end”
University of Sunderland CIF 102/FIF102 Fundamentals of DatabasesUnit 15 Programming in Microsoft Access using VBA Using VBA to add functionality.
Programming with Visual C++: Concepts and Projects Chapter 2B: Reading, Processing and Displaying Data (Tutorial)
Visual Basic Programming
Microsoft Visual Basic 2005: Reloaded Second Edition Chapter 3 Variables, Constants, Methods, and Calculations.
Data Types and Variables. Data Type! Computers are all about Data! Data can be in the form of Text Dates Sounds Pictures.
MS Visual Basic 6 Walter Milner. VB 6 0 Introduction –background to VB, A hello World program 1 Core language 1 –Projects, data types, variables, forms,
Introduction to Visual Basic Programming. Introduction Simple Program: Printing a Line of Text Another Simple Program: Adding Integers Memory Concepts.
Chapter 3 Syntax, Errors, and Debugging Fundamentals of Java.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Second Edition by Tony Gaddis.
Chapter-1 Introduction to Visual Basic GUI- A GUI is a graphical (rather than purely textual) user interface to a computer. The term came into existence.
Chapter 4 Variables and constants. 4.1 Variables -Use of variables is good programming style -easier to modify -easier for a programmer to understand.
Tutorial 3: Using Variables and Constants1 Tutorial 3 Using Variables and Constants.
CHAPTER 6 LESSON B Creating Custom Forms. Lesson B Objectives  Suppress default system messages  Create alerts and messages to provide system feedback.
Calculator Program Explained by Arafa Hamed. First Designing The Interface Ask yourself how many places are there that will be used to input numbers?
Variables and Expressions Programming Right from the Start with Visual Basic.NET 1/e 7.
Microsoft Visual Basic 2012 CHAPTER FOUR Variables and Arithmetic Operations.
Creation of Variables with Numeric, alphanumeric, date, picture, memo data types Constant - A quantity that does not change during the execution of a program.
Microsoft Visual C# 2010 Fourth Edition Chapter 3 Using GUI Objects and the Visual Studio IDE.
Making Interactive Programs with Visual Basic .NET
Chapter 4.  Variables – named memory location that stores a value.  Variables allows the use of meaningful names which makes the code easier to read.
Slide 1 Chapter 3 Variables  A variable is a name for a value stored in memory.  Variables are used in programs so that values can be represented with.
Using Forms and Form Elements In Visual Basic.NET.
© 2006 Lawrenceville Press Slide 1 Chapter 4 Variables  A variable is a name for a value stored in memory.  Variables are created using a declaration.
Slide 1 Chapter 3 Variables  A variable is a name for a value stored in memory.  Variables are created using a declaration statement. For example: Dim.
Visual Basic/ Visual Studio Brandon Large. Connecting to prior knowledge In your notes write down what the two main parts of the computer are. The “software”
Visual Basic Fundamental Concepts
Egyptian Language School Computer Department
A variable is a name for a value stored in memory.
Chapter Topics 15.1 Graphical User Interfaces
Working with Forms in Visual Basic
Variables and Arithmetic Operations
Microsoft Visual Basic 2005 BASICS
Visual Basic..
Building an Application in the Visual Basic .NET Environment
Additional Topics in VB.NET
Chapter 15: GUI Applications & Event-Driven Programming
Introduction to Programming
Tutorial 10: Programming with javascript
Presentation transcript:

Fundamentals of GUI Programming

Objectives: At the end of the session, you should be able to: describe the guidelines that are used for creating user-friendly graphical user interfaces; ascertain steps in creating applications; define variables and data types; and construct and execute applications by correctly following syntax and semantics.

Guidelines for GUI Design Give priority to the user Design for clarity Design for consistency Provide visual and audio feedback Provide keyboard support Use of appropriate controls

KEYBOARD Support

Steps in Creating Simple Applications Create the User Interface (GUI) Set the Properties of the Objects Enter the appropriate Source Code Run the Program

Create the User Interface

Set the Properties of the Objects

Enter the Source Code

Run the Program

GUI Controls Used to interact with the application. A control is defined by: – Property – Event – Method

Property It refers to the characteristic or parameter of a control –Control’s properties determine its name, color, size, location and appearance on the screen

Types of Properties Properties of a control can be classified into the following categories: –Design time property - This type of property can be changed only during the design phase of the program. –Runtime property - This type of property will only take effect when the program is running. –Design time/Runtime property - This type of property can be changed during the design time as well as during the runtime.

PROPERTIES TEXT of a LabelBox TEXT of a TextBox BackColor of a Form

Event It refers to an action that happens during the program’s execution – clicking of a button, pressing a key, changing the text of a textbox Method It refers to the function of a control It commands the control on what it should perform once an event occurs. –open, close, move, refresh

Naming a Visual Basic Control SYNTAX: Control Prefix Label BoxlbllblHelloWorld Command ButtonbtnbtnExit Text BoxtxttxtRemarks FormfrmfrmProgram

Naming a Visual Basic Control

Variables Variable – a named memory location capable of storing values based on its definition –Numeric: used to store a value which is numeric in nature –String: used for storing strings

RULES IN NAMING VARIABLES 1.It must start with an alphabetic character. 2.It can contain letters, numbers and an underscore (_). 3.It should not exceed 255 characters. 4.It should not contain any special character and a space.

Data Types Data Type – an element of a variable that verifies the kind of data it can store. –Boolean- Short (9) –Integer- Long (17) –Single- Double –String ** the value of string must be enclosed within “ ”

Variable Declarations SYNTAX: Dim as OR: Dim Suffixes: Integer( % )Double( # ) Single( ! )Long ( & ) String( $ )

Sample Variable Declarations Ex 1. X and Y are of integer data type. DimX as integer Dim Y% Ex 2. Name is of string data type. Dim Name$

The Assignment Statement SYNTAX: ObjectName.PropertyName = Value WHERE: ObjectName – name of the control PropertyName – property of the control Value - a constant or a variable Ex: lblDisplay.text = “Hello!”

Assignment Statement Example1: Assign the value “Sophomores” in the textbox named as Remarks. ANS: Remarks.Text = “Sophomores” Example2: Assign the value Num1 in the textbox named txtNum1. ANS: TxtNum1.Text = Num1

Example3: Delete the text in the textbox named as Remarks. ANS: Remarks.Text = “ ”

(Save As: Info)

Source Code:

HANDS-ON Activity #1 Save As: StudInfo Create a program that will accept the name, school, and address of a student using textboxes. Once the display button is clicked the student information supplied in the textboxes will be displayed in a single message box.

Sample output: