SlideShare uma empresa Scribd logo
1 de 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?

Mais conteúdo relacionado

Mais procurados

Graphical User Interface (Gui)
Graphical User Interface (Gui)Graphical User Interface (Gui)
Graphical User Interface (Gui)Bilal Amjad
 
VB.Net-Controls and events
VB.Net-Controls and eventsVB.Net-Controls and events
VB.Net-Controls and eventsPrachi Sasankar
 
Chat application in java using swing and socket programming.
Chat application in java using swing and socket programming.Chat application in java using swing and socket programming.
Chat application in java using swing and socket programming.Kuldeep Jain
 
Object Oriented Analysis Design using UML
Object Oriented Analysis Design using UMLObject Oriented Analysis Design using UML
Object Oriented Analysis Design using UMLAjit Nayak
 
Android styles and themes
Android   styles and themesAndroid   styles and themes
Android styles and themesDeepa Rani
 
[Android] Widget Event Handling
[Android] Widget Event Handling[Android] Widget Event Handling
[Android] Widget Event HandlingNikmesoft Ltd
 
User Interface Design - Module 1 Introduction
User Interface Design - Module 1 IntroductionUser Interface Design - Module 1 Introduction
User Interface Design - Module 1 IntroductionbrindaN
 
Windows form application_in_vb(vb.net --3 year)
Windows form application_in_vb(vb.net --3 year)Windows form application_in_vb(vb.net --3 year)
Windows form application_in_vb(vb.net --3 year)Ankit Gupta
 
Event Handling in Java
Event Handling in JavaEvent Handling in Java
Event Handling in JavaAyesha Kanwal
 
Android activity
Android activityAndroid activity
Android activityKrazy Koder
 
VB.NET:An introduction to Namespaces in .NET framework
VB.NET:An introduction to  Namespaces in .NET frameworkVB.NET:An introduction to  Namespaces in .NET framework
VB.NET:An introduction to Namespaces in .NET frameworkRicha Handa
 

Mais procurados (20)

Visual Basic Controls ppt
Visual Basic Controls pptVisual Basic Controls ppt
Visual Basic Controls ppt
 
Graphical User Interface (Gui)
Graphical User Interface (Gui)Graphical User Interface (Gui)
Graphical User Interface (Gui)
 
Microsoft visual basic 6
Microsoft visual basic 6Microsoft visual basic 6
Microsoft visual basic 6
 
VB.Net-Controls and events
VB.Net-Controls and eventsVB.Net-Controls and events
VB.Net-Controls and events
 
Vb basics
Vb basicsVb basics
Vb basics
 
Chat application in java using swing and socket programming.
Chat application in java using swing and socket programming.Chat application in java using swing and socket programming.
Chat application in java using swing and socket programming.
 
Object Oriented Analysis Design using UML
Object Oriented Analysis Design using UMLObject Oriented Analysis Design using UML
Object Oriented Analysis Design using UML
 
4.C#
4.C#4.C#
4.C#
 
Android styles and themes
Android   styles and themesAndroid   styles and themes
Android styles and themes
 
Meaning Of VB
Meaning Of VBMeaning Of VB
Meaning Of VB
 
visual basic programming
visual basic programmingvisual basic programming
visual basic programming
 
[Android] Widget Event Handling
[Android] Widget Event Handling[Android] Widget Event Handling
[Android] Widget Event Handling
 
Java essential notes
Java essential notesJava essential notes
Java essential notes
 
User Interface Design - Module 1 Introduction
User Interface Design - Module 1 IntroductionUser Interface Design - Module 1 Introduction
User Interface Design - Module 1 Introduction
 
Sdi & mdi
Sdi & mdiSdi & mdi
Sdi & mdi
 
Windows form application_in_vb(vb.net --3 year)
Windows form application_in_vb(vb.net --3 year)Windows form application_in_vb(vb.net --3 year)
Windows form application_in_vb(vb.net --3 year)
 
Event Handling in Java
Event Handling in JavaEvent Handling in Java
Event Handling in Java
 
Android activity
Android activityAndroid activity
Android activity
 
VB.NET:An introduction to Namespaces in .NET framework
VB.NET:An introduction to  Namespaces in .NET frameworkVB.NET:An introduction to  Namespaces in .NET framework
VB.NET:An introduction to Namespaces in .NET framework
 
HCI
HCIHCI
HCI
 

Destaque

Event driven programming amazeballs
Event driven programming amazeballsEvent driven programming amazeballs
Event driven programming amazeballsMsWillcox
 
(WRK302) Event-Driven Programming
(WRK302) Event-Driven Programming(WRK302) Event-Driven Programming
(WRK302) Event-Driven ProgrammingAmazon Web Services
 
Ch 3 event driven programming
Ch 3 event driven programmingCh 3 event driven programming
Ch 3 event driven programmingChaffey College
 
Event oriented programming
Event oriented programmingEvent oriented programming
Event oriented programmingAshwini Awatare
 
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 DynamoDBAmazon Web Services
 
Software development lifecycle
Software development lifecycleSoftware development lifecycle
Software development lifecyclenicky_walters
 
Ndu06 typesof language
Ndu06 typesof languageNdu06 typesof language
Ndu06 typesof languagenicky_walters
 
Design documentation
Design documentationDesign documentation
Design documentationnicky_walters
 

Destaque (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
 
Ch 3 event driven programming
Ch 3 event driven programmingCh 3 event driven programming
Ch 3 event driven programming
 
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
 

Semelhante a 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
 
visual basic v6 introduction
visual basic v6 introductionvisual basic v6 introduction
visual basic v6 introductionbloodyedge03
 
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
 

Semelhante a 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
 
visual basic v6 introduction
visual basic v6 introductionvisual basic v6 introduction
visual basic v6 introduction
 
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
 

Último

Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
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
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
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
 
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
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
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
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
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
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 

Último (20)

Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
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...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
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
 
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
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
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
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
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...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 

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?