SlideShare a Scribd company logo
1 of 14
1 
What is Event Driven 
Programming? 
Visual Studio 
and 
VB.NET
2 
P1: Key Features of EDP 
1. Event loops 
2. GUI design (Forms & Controls 
3. Trigger functions 
4. Event handlers
3 
P2: Demonstrate the use of event 
driven tools and techniques 
Using Visual Studio and VB.NET language 
Demonstrate the development process with screenshots 
and code examples, to show the main choices available 
IDE Tools inc: 
GUI form design 
Add & edit controls 
Choice of triggers 
Code colour & dropdown 
Debugging tools 
 Error list 
 Breakpoints & step 
through code 
Coding Techniques inc: 
Variables and Datatypes 
 Const, Global, Local 
 Integer, boolean, decimal, 
string, date 
Selection 
 If...Else & Select...Case 
Loops 
 Fixed & Conditional
4 
Event Loops 
Programmers are often not aware of these: 
The Event loop keeps testing the user interface to see if 
anything has happened e.g. a button click or a key 
pressed. Open Task Manager to see which programs are running 
When an event is detected, it is passed to the list of 
identified trigger functions, which then launches a 
response to the event. 
The event handlers are the actual program code 
modules that are executed when a particular trigger has 
occurred. 
Other (non user) activities can also cause an event to 
trigger – typically used in networking and when reading 
from or writing to files.
5 
Event Loop 
1 User interacts with page 
2 An ‘event’ is triggered 
EVENT! 
The page’s appearance is 3 A code handler runs in response 
updated/modified as a result 
4
6 
Forms and Controls 
A GUI (graphical user interface) is what the user 
sees when the program runs and usually consists of 
one or several forms 
Event driven programming is particularly suitable for 
GUIs - uses WIMP system 
Windows, Icons, Menus, Pointers 
Programmer can assist user with intuitive interface, 
restrict input to a limited range, provide visual 
feedback and context-sensitive help 
Event driven programs respond to events triggered 
by the user via the mouse or keyboard
7 
Forms and Controls 
Common methods for user interaction include clicking 
the mouse or pressing a key 
Each form contains various controls which allow the 
user to interact with the program in different ways 
e.g. Buttons, Textboxes, Labels, Menus, Pictureboxes, Timers 
Wide choice of controls can be customised for use by 
Select from toolbar and drop onto the form 
change its properties in design view (text, image, visible) 
Show form design in IDE and choice of controls in toolbox 
Add different types controls to provide input and feedback 
inc. visual and non-visual controls (timer) 
Change the properties (inc Name) and explain purpose
8 
Trigger functions 
Event driven programs respond to events 
triggered by the user 
The programmer chooses which event(s) 
to respond to by selecting the appropriate 
trigger function. 
Every object has a range of trigger 
functions – one for each possible event 
Different controls have different events 
(events for a text box not the same for a 
button) 
A Button has a Click event, a GotFocus event, a 
MouseHover event etc 
Button events
9 
Trigger Functions 
Triggers can also come from unseen events e.g. Timer 
Double clicking a control will select its default event 
Timer1_Tick() 
MenuItem1_Click() 
Forms also have events inc: 
Load (open for first time, set default values) 
KeyDown (when the user presses a key) 
Demonstrate how to create trigger functions for different controls 
inc. mouse, keyboard and timer (control event) 
Show how to select different triggers for the same control 
Explain how trigger functions are used in your program
10 
Event Handlers 
An event triggers the appropriate event handler 
Event handlers contain the code that runs when an 
event occurs 
These event handlers are self-contained sections of 
code – also called Procedures or Subroutines 
VB.NET uses Sub/End Sub to start and end the code 
This allows the programmer to work on one event of 
one control at a time and makes testing easier
11 
Event Handlers 
Demonstrate and explain different coding techniques 
Variables 
 Different datatypes 
 Local and Global 
Selection 
 If...Else 
 Select...Case 
Loops 
 Fixed loop e.g. For...Next 
 Conditional loop e.g. Do...Loop While 
Show how IDE assists with coding and debugging 
 Pre-written code and drop-down lists showing choice of 
possible commands 
 Errors are highlighted and step through debugging
12 
Advantages 
Flexibility: 
Wide choice of controls and trigger functions - 
programmer can decide what will happen when 
Suitability for GUI: 
WIMP system (Windows, Icons, Menus, Pointers) 
Simplicity and Ease of development: 
Programmers can add and code one object at a 
time, using simple constructs 
Pre-written code and drop-down lists showing 
choice of possible commands 
Errors are highlighted and step through debugging
13 
Disadvantages 
Errors can be more difficult to spot than with 
simpler, procedural programs 
Programs with complex GUIs may be slower 
to load and run than simpler programs – 
particularly if RAM is insufficient 
Programs with too many forms can be very 
confusing and/or frustrating for the user
14 
Which control would a programmer 
use to….? 
Allow a Yes/ No answer only? 
Allow a wide range of keyboard input? 
Limit user input to the numbers 1, 2, 3 & 4? 
Allow a user to subtly change the colour or 
brightness selected in a graphics application 
Allow a user to access commands without the 
mouse, but using keyboard navigation only?

More Related Content

What's hot

Vb6.0 Introduction
Vb6.0 IntroductionVb6.0 Introduction
Vb6.0 IntroductionTennyson
 
Software Testing and Quality Assurance unit1
Software Testing and Quality Assurance  unit1Software Testing and Quality Assurance  unit1
Software Testing and Quality Assurance unit1Bhagyashree Dhakulkar
 
Graphical User Interface
Graphical User Interface Graphical User Interface
Graphical User Interface Bivek Pakuwal
 
Ch 3 event driven programming
Ch 3 event driven programmingCh 3 event driven programming
Ch 3 event driven programmingChaffey College
 
visual basic v6 introduction
visual basic v6 introductionvisual basic v6 introduction
visual basic v6 introductionbloodyedge03
 
Uml diagrams
Uml diagramsUml diagrams
Uml diagramsbarney92
 
Event+driven+programming key+features
Event+driven+programming key+featuresEvent+driven+programming key+features
Event+driven+programming key+featuresFaisal Aziz
 
Problem solving using Computer
Problem solving using ComputerProblem solving using Computer
Problem solving using ComputerDavid Livingston J
 
Organization and team structures
Organization and team structuresOrganization and team structures
Organization and team structuresNur Islam
 
Introduction to Visual Basic 6.0 Fundamentals
Introduction to Visual Basic 6.0 FundamentalsIntroduction to Visual Basic 6.0 Fundamentals
Introduction to Visual Basic 6.0 FundamentalsSanay Kumar
 
Introduction to programming using Visual Basic 6
Introduction to programming using Visual Basic 6Introduction to programming using Visual Basic 6
Introduction to programming using Visual Basic 6Jeanie Arnoco
 
E learning excel vba programming lesson 1
E learning excel vba programming  lesson 1E learning excel vba programming  lesson 1
E learning excel vba programming lesson 1Vijay Perepa
 
Exception Handling in VB.Net
Exception Handling in VB.NetException Handling in VB.Net
Exception Handling in VB.Netrishisingh190
 
Microsoft Word
Microsoft WordMicrosoft Word
Microsoft WordJack Frost
 
Visual basic 6.0
Visual basic 6.0Visual basic 6.0
Visual basic 6.0sanket1996
 
Collaboration diagram- UML diagram
Collaboration diagram- UML diagram Collaboration diagram- UML diagram
Collaboration diagram- UML diagram Ramakant Soni
 
Characteristics of Software
Characteristics of SoftwareCharacteristics of Software
Characteristics of SoftwareUpekha Vandebona
 

What's hot (20)

Vb6.0 Introduction
Vb6.0 IntroductionVb6.0 Introduction
Vb6.0 Introduction
 
Software Testing and Quality Assurance unit1
Software Testing and Quality Assurance  unit1Software Testing and Quality Assurance  unit1
Software Testing and Quality Assurance unit1
 
Graphical User Interface
Graphical User Interface Graphical User Interface
Graphical User Interface
 
Ch 3 event driven programming
Ch 3 event driven programmingCh 3 event driven programming
Ch 3 event driven programming
 
visual basic v6 introduction
visual basic v6 introductionvisual basic v6 introduction
visual basic v6 introduction
 
Uml diagrams
Uml diagramsUml diagrams
Uml diagrams
 
Event+driven+programming key+features
Event+driven+programming key+featuresEvent+driven+programming key+features
Event+driven+programming key+features
 
Problem solving using Computer
Problem solving using ComputerProblem solving using Computer
Problem solving using Computer
 
Organization and team structures
Organization and team structuresOrganization and team structures
Organization and team structures
 
Flowchart
FlowchartFlowchart
Flowchart
 
Introduction to Visual Basic 6.0 Fundamentals
Introduction to Visual Basic 6.0 FundamentalsIntroduction to Visual Basic 6.0 Fundamentals
Introduction to Visual Basic 6.0 Fundamentals
 
Introduction to programming using Visual Basic 6
Introduction to programming using Visual Basic 6Introduction to programming using Visual Basic 6
Introduction to programming using Visual Basic 6
 
E learning excel vba programming lesson 1
E learning excel vba programming  lesson 1E learning excel vba programming  lesson 1
E learning excel vba programming lesson 1
 
Exception Handling in VB.Net
Exception Handling in VB.NetException Handling in VB.Net
Exception Handling in VB.Net
 
Android UI
Android UIAndroid UI
Android UI
 
Microsoft Word
Microsoft WordMicrosoft Word
Microsoft Word
 
Visual basic 6.0
Visual basic 6.0Visual basic 6.0
Visual basic 6.0
 
Collaboration diagram- UML diagram
Collaboration diagram- UML diagram Collaboration diagram- UML diagram
Collaboration diagram- UML diagram
 
Debugging
DebuggingDebugging
Debugging
 
Characteristics of Software
Characteristics of SoftwareCharacteristics of Software
Characteristics of Software
 

Viewers also liked

Viewers also liked (20)

Controls
ControlsControls
Controls
 
Design for edp
Design for edpDesign for edp
Design for edp
 
Event driven programming amazeballs
Event driven programming amazeballsEvent driven programming amazeballs
Event driven programming amazeballs
 
Decisions
DecisionsDecisions
Decisions
 
(WRK302) Event-Driven Programming
(WRK302) Event-Driven Programming(WRK302) Event-Driven Programming
(WRK302) Event-Driven Programming
 
Data types vbnet
Data types vbnetData types vbnet
Data types vbnet
 
Event driventheory
Event driventheoryEvent driventheory
Event driventheory
 
Input output
Input outputInput output
Input output
 
Event oriented programming
Event oriented programmingEvent oriented programming
Event oriented programming
 
Simple debugging
Simple debuggingSimple debugging
Simple debugging
 
Using loops
Using loopsUsing loops
Using loops
 
AWS December 2015 Webinar Series - Design Patterns using Amazon DynamoDB
AWS December 2015 Webinar Series - Design Patterns using Amazon DynamoDBAWS December 2015 Webinar Series - Design Patterns using Amazon DynamoDB
AWS December 2015 Webinar Series - Design Patterns using Amazon DynamoDB
 
Decisions
DecisionsDecisions
Decisions
 
Simple debugging
Simple debuggingSimple debugging
Simple debugging
 
Data types vbnet
Data types vbnetData types vbnet
Data types vbnet
 
Software development lifecycle
Software development lifecycleSoftware development lifecycle
Software development lifecycle
 
Ndu06 typesof language
Ndu06 typesof languageNdu06 typesof language
Ndu06 typesof language
 
Data structures vb
Data structures vbData structures vb
Data structures vb
 
Design documentation
Design documentationDesign documentation
Design documentation
 
Algorithms
AlgorithmsAlgorithms
Algorithms
 

Similar to Event driven theory

SWE-401 - 8. Software User Interface Design
SWE-401 - 8. Software User Interface DesignSWE-401 - 8. Software User Interface Design
SWE-401 - 8. Software User Interface Designghayour abbas
 
Introduction to Visual Basic 6.0
Introduction to Visual Basic 6.0Introduction to Visual Basic 6.0
Introduction to Visual Basic 6.0DivyaR219113
 
06 win forms
06 win forms06 win forms
06 win formsmrjw
 
2 Module - Operating Systems Configuration and Use by Mark John Lado
2 Module - Operating Systems Configuration and Use by Mark John Lado2 Module - Operating Systems Configuration and Use by Mark John Lado
2 Module - Operating Systems Configuration and Use by Mark John LadoMark John Lado, MIT
 
WinRunner Training
WinRunner TrainingWinRunner Training
WinRunner Trainingsunny.deb
 
Publication Non Visual Components
Publication Non Visual ComponentsPublication Non Visual Components
Publication Non Visual Componentssatyres
 
2 working with operating system
2 working with operating system2 working with operating system
2 working with operating systemMukesh Thakur
 
Functional Requirements Of System Requirements
Functional Requirements Of System RequirementsFunctional Requirements Of System Requirements
Functional Requirements Of System RequirementsLaura Arrigo
 
ANDROID LAB MANUAL.doc
ANDROID LAB MANUAL.docANDROID LAB MANUAL.doc
ANDROID LAB MANUAL.docPalakjaiswal43
 
RPA Developer Kickstarter | Day 3: UI Automation and UiPath Selectors
RPA Developer Kickstarter | Day 3: UI Automation and UiPath SelectorsRPA Developer Kickstarter | Day 3: UI Automation and UiPath Selectors
RPA Developer Kickstarter | Day 3: UI Automation and UiPath SelectorsRohit Radhakrishnan
 
Operating system
Operating systemOperating system
Operating systemkhair20
 

Similar to Event driven theory (20)

SWE-401 - 8. Software User Interface Design
SWE-401 - 8. Software User Interface DesignSWE-401 - 8. Software User Interface Design
SWE-401 - 8. Software User Interface Design
 
Unit 2
Unit 2Unit 2
Unit 2
 
Unit-1.pptx
Unit-1.pptxUnit-1.pptx
Unit-1.pptx
 
2.5 gui
2.5 gui2.5 gui
2.5 gui
 
Introduction to Visual Basic 6.0
Introduction to Visual Basic 6.0Introduction to Visual Basic 6.0
Introduction to Visual Basic 6.0
 
06 win forms
06 win forms06 win forms
06 win forms
 
Unit-1.pptx
Unit-1.pptxUnit-1.pptx
Unit-1.pptx
 
2 Module - Operating Systems Configuration and Use by Mark John Lado
2 Module - Operating Systems Configuration and Use by Mark John Lado2 Module - Operating Systems Configuration and Use by Mark John Lado
2 Module - Operating Systems Configuration and Use by Mark John Lado
 
WinRunner Training
WinRunner TrainingWinRunner Training
WinRunner Training
 
Publication Non Visual Components
Publication Non Visual ComponentsPublication Non Visual Components
Publication Non Visual Components
 
Working with Operating System
Working with Operating SystemWorking with Operating System
Working with Operating System
 
2 working with operating system
2 working with operating system2 working with operating system
2 working with operating system
 
VB.Net GUI Unit_01
VB.Net GUI Unit_01VB.Net GUI Unit_01
VB.Net GUI Unit_01
 
Functional Requirements Of System Requirements
Functional Requirements Of System RequirementsFunctional Requirements Of System Requirements
Functional Requirements Of System Requirements
 
Software
Software Software
Software
 
ANDROID LAB MANUAL.doc
ANDROID LAB MANUAL.docANDROID LAB MANUAL.doc
ANDROID LAB MANUAL.doc
 
Software
SoftwareSoftware
Software
 
Vb6.0 intro
Vb6.0 introVb6.0 intro
Vb6.0 intro
 
RPA Developer Kickstarter | Day 3: UI Automation and UiPath Selectors
RPA Developer Kickstarter | Day 3: UI Automation and UiPath SelectorsRPA Developer Kickstarter | Day 3: UI Automation and UiPath Selectors
RPA Developer Kickstarter | Day 3: UI Automation and UiPath Selectors
 
Operating system
Operating systemOperating system
Operating system
 

Recently uploaded

MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...apidays
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 

Recently uploaded (20)

MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 

Event driven theory

  • 1. 1 What is Event Driven Programming? Visual Studio and VB.NET
  • 2. 2 P1: Key Features of EDP 1. Event loops 2. GUI design (Forms & Controls 3. Trigger functions 4. Event handlers
  • 3. 3 P2: Demonstrate the use of event driven tools and techniques Using Visual Studio and VB.NET language Demonstrate the development process with screenshots and code examples, to show the main choices available IDE Tools inc: GUI form design Add & edit controls Choice of triggers Code colour & dropdown Debugging tools  Error list  Breakpoints & step through code Coding Techniques inc: Variables and Datatypes  Const, Global, Local  Integer, boolean, decimal, string, date Selection  If...Else & Select...Case Loops  Fixed & Conditional
  • 4. 4 Event Loops Programmers are often not aware of these: The Event loop keeps testing the user interface to see if anything has happened e.g. a button click or a key pressed. Open Task Manager to see which programs are running When an event is detected, it is passed to the list of identified trigger functions, which then launches a response to the event. The event handlers are the actual program code modules that are executed when a particular trigger has occurred. Other (non user) activities can also cause an event to trigger – typically used in networking and when reading from or writing to files.
  • 5. 5 Event Loop 1 User interacts with page 2 An ‘event’ is triggered EVENT! The page’s appearance is 3 A code handler runs in response updated/modified as a result 4
  • 6. 6 Forms and Controls A GUI (graphical user interface) is what the user sees when the program runs and usually consists of one or several forms Event driven programming is particularly suitable for GUIs - uses WIMP system Windows, Icons, Menus, Pointers Programmer can assist user with intuitive interface, restrict input to a limited range, provide visual feedback and context-sensitive help Event driven programs respond to events triggered by the user via the mouse or keyboard
  • 7. 7 Forms and Controls Common methods for user interaction include clicking the mouse or pressing a key Each form contains various controls which allow the user to interact with the program in different ways e.g. Buttons, Textboxes, Labels, Menus, Pictureboxes, Timers Wide choice of controls can be customised for use by Select from toolbar and drop onto the form change its properties in design view (text, image, visible) Show form design in IDE and choice of controls in toolbox Add different types controls to provide input and feedback inc. visual and non-visual controls (timer) Change the properties (inc Name) and explain purpose
  • 8. 8 Trigger functions Event driven programs respond to events triggered by the user The programmer chooses which event(s) to respond to by selecting the appropriate trigger function. Every object has a range of trigger functions – one for each possible event Different controls have different events (events for a text box not the same for a button) A Button has a Click event, a GotFocus event, a MouseHover event etc Button events
  • 9. 9 Trigger Functions Triggers can also come from unseen events e.g. Timer Double clicking a control will select its default event Timer1_Tick() MenuItem1_Click() Forms also have events inc: Load (open for first time, set default values) KeyDown (when the user presses a key) Demonstrate how to create trigger functions for different controls inc. mouse, keyboard and timer (control event) Show how to select different triggers for the same control Explain how trigger functions are used in your program
  • 10. 10 Event Handlers An event triggers the appropriate event handler Event handlers contain the code that runs when an event occurs These event handlers are self-contained sections of code – also called Procedures or Subroutines VB.NET uses Sub/End Sub to start and end the code This allows the programmer to work on one event of one control at a time and makes testing easier
  • 11. 11 Event Handlers Demonstrate and explain different coding techniques Variables  Different datatypes  Local and Global Selection  If...Else  Select...Case Loops  Fixed loop e.g. For...Next  Conditional loop e.g. Do...Loop While Show how IDE assists with coding and debugging  Pre-written code and drop-down lists showing choice of possible commands  Errors are highlighted and step through debugging
  • 12. 12 Advantages Flexibility: Wide choice of controls and trigger functions - programmer can decide what will happen when Suitability for GUI: WIMP system (Windows, Icons, Menus, Pointers) Simplicity and Ease of development: Programmers can add and code one object at a time, using simple constructs Pre-written code and drop-down lists showing choice of possible commands Errors are highlighted and step through debugging
  • 13. 13 Disadvantages Errors can be more difficult to spot than with simpler, procedural programs Programs with complex GUIs may be slower to load and run than simpler programs – particularly if RAM is insufficient Programs with too many forms can be very confusing and/or frustrating for the user
  • 14. 14 Which control would a programmer use to….? Allow a Yes/ No answer only? Allow a wide range of keyboard input? Limit user input to the numbers 1, 2, 3 & 4? Allow a user to subtly change the colour or brightness selected in a graphics application Allow a user to access commands without the mouse, but using keyboard navigation only?