Introduction to visual programming C#. Learning Outcomes In this chapter, you will learn about :  Event-Based Programming  The Event Based Model  Application.

Slides:



Advertisements
Similar presentations
What Was I Thinking??. Key Terms 1. Control 1. Control 2. Design Mode 2. Design Mode 3. Event 3. Event 4. Form 4. Form 5. Interface 5. Interface 6. Properties.
Advertisements

© by Pearson Education, Inc. All Rights Reserved.
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,
CA 121 Intro to Programming Tariq Aziz and Kevin Jones GUI Programming in Visual Studio.NET Chapter 1 Tariq Aziz and Kevin Jones.
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.
Chapter 1- Visual Basic Schneider 1 Chapter 1 An Introduction to Computers and Visual Basic.
1 Introduction to the Visual Studio.NET IDE Powerpoint slides modified from Deitel & Deitel.
1 Flash Programming Introduction Script Assist. 2 Course Description This course concentrates on the teaching of Actionscript, the programming language.
Events in Java Swing Chris North cs3724: HCI. Typical command line program Non-interactive Linear execution program: main() { code; }
Microsoft Visual Basic 2012 CHAPTER TWO Program and Graphical User Interface Design.
Visual Basic Chapter 1 Mr. Wangler.
Hands-on Introduction to Visual Basic.NET Programming Right from the Start with Visual Basic.NET 1/e 6.
Unit 20: Event Driven Programming
ACM/JETT Workshop - August 4-5, ExceptionHandling and User Interfaces (Event Delegation, Inner classes) using Swing.
CS 0004 –Lecture 1 Wednesday, Jan 5 th, 2011 Roxana Gheorghiu.
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
Tutorial 111 The Visual Studio.NET Environment The major differences between Visual Basic 6.0 and Visual Basic.NET are the latter’s support for true object-oriented.
Visual Basic 2005 CHAPTER 2 Program and Graphical User Interface Design.
1 Chapter Eleven Handling Events. 2 Objectives Learn about delegates How to create composed delegates How to handle events How to use the built-in EventHandler.
Chapter 9: Visual Programming Basics Object-Oriented Program Development Using Java: A Class-Centered Approach.
University of Sunderland CIF 102/FIF102 Fundamentals of DatabasesUnit 15 Programming in Microsoft Access using VBA Using VBA to add functionality.
Creating Graphical User Interfaces (GUI’s) with MATLAB By Jeffrey A. Webb OSU Gateway Coalition Member.
Visual Basic 2005 CHAPTER 2 Program and Graphical User Interface Design.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 8 Debugging, Creating Executable Files, and Distributing a Windows Application.
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.
Java Applets: GUI Components, Events, Etc. Ralph Westfall June, 2010.
Object-Oriented Program Development Using Java: A Class-Centered Approach, Enhanced Edition.
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.
Object Oriented Programming.  Interface  Event Handling.
SEEM3460 Tutorial GUI in Java. Some Basic GUI Terms Component (Control in some languages) the basic GUI unit something visible something that user can.
Chapter 3 - VB.NET by Schneider1 Chapter 3 – Fundamentals of Programming in VB.NET Part I VB.NET Controls VB.NET Events.
GUI Programming Joseph Sant Sheridan College. Agenda Elements of GUI programming Component-Based Programming. Event-Based Programming. A process using.
Microsoft Visual Basic 2010 CHAPTER TWO Program and Graphical User Interface Design.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 4: Events Programming with Alice and Java First Edition by John Lewis.
User Interface Programming in C#: Basics and Events Chris North CS 3724: HCI.
 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.
12-Jun-16 Event loops. 2 Programming in prehistoric times Earliest programs were all “batch” processing There was no interaction with the user Input Output.
Dive Into® Visual Basic 2010 Express
Collision Theory and Logic
Topics Graphical User Interfaces Using the tkinter Module
Collision Theory and Logic
Chapter Topics 15.1 Graphical User Interfaces
Event-driven programming
Event loops 16-Jun-18.
Program and Graphical User Interface Design
Chapter Eleven Handling Events.
1. Introduction to Visual Basic
An Introduction to Computers and Visual Basic
Lesson 1: Buttons and Events – 12/18
Introduction to Events
Program and Graphical User Interface Design
Event Driven Programming
Introduction to Computing Using Java
Hands-on Introduction to Visual Basic .NET
CIS16 Application Development Programming with Visual Basic
Event loops.
Event loops 17-Jan-19.
Event loops 17-Jan-19.
An Introduction to Computers and Visual Basic
Chapter 15: GUI Applications & Event-Driven Programming
Event loops 8-Apr-19.
Event loops.
Event loops.
Event loops 19-Aug-19.
Presentation transcript:

Introduction to visual programming C#

Learning Outcomes In this chapter, you will learn about :  Event-Based Programming  The Event Based Model  Application Programming Interface (API)  Different types of programs  The first program with visual C#

Event Based Programming  Event-based programs provide fully functioning GUIs  An event is initiated by a user action  A program must: – Correctly assess which specific event has occurred – Provide the appropriate code to perform an action based on the identified event

Event Based Programming

 Actions that trigger events include: –Placing the mouse pointer over a button and clicking the left mouse button –Using the TAB key until the desired button is highlighted with a dotted line then pushing the Enter key –Pressing an accelerator key  The sequence of events in a program are controlled by the user

 Operating system: –Has total control of computer –Never relinquishes control to any executing programs  Most executing programs spend the majority of their time in a sleep type of mode  When an event occurs: –The operating system passes event information to the appropriate application –Permits the application to take action The Event-Based Model

Visual Studio.Net controls designer Properties, events

GUI Tree Structure Panel Button Form Label GUIInternal structure containers Panel Button Form Label

Components API Properties Like member fields Get, set E.g. Button1.Text = “Press Me” Methods Like member functions Tell component to do something E.g. Button1.Show( ) Events Like callback functions Receive notifications from component E.g. Button1.Click(e)

Non-interactive Linear execution program: main() { code; } Typical command line program

Interactive command line program  User input commands  Non-linear execution  Unpredictable order program: main() { decl data storage; initialization code; loop { get command; switch(command) { command1: code; command2: code; … }

 User input commands  Non-linear execution  Unpredictable order  Event callback procs Typical GUI program GUI program: main() { decl data storage; initialization code; create GUI; register callbacks; main event loop; } Callback1()//button1 press {code; } Callback2()//button2 press {code; } …

C Sharp (C#)  C# was designed specifically for the.NET platform as a language that would enable programmers to migrate easily to.NET.  C# is object oriented and has access to a powerful class library of prebuilt components.  It has roots in C, C++ and Java, adapting the best features of each.  Microsoft introduced C# along with its.NET strategy in  The.NET platform allows applications to be distributed to a variety of devices.

The first program

The purpose of the code is so that you can add your own methods to handle the logic for your application, such as what happens when the user clicks the OK button The first program

Double click the ok Button on the form. A new method has been added called ok_click. We add the code to the ok_click method The first The first program