SlideShare una empresa de Scribd logo
1 de 9
Handling Mouse Events
Mouse events occur with mouse movements in forms
and controls. Following are the various mouse events
related with a Control class −
MouseDown − it occurs when a mouse button is pressed
MouseEnter − it occurs when the mouse pointer enters
the control
MouseHover − it occurs when the mouse pointer hovers
over the control
MouseLeave − it occurs when the mouse pointer leaves
the control
MouseMove − it occurs when the mouse pointer moves
over the control
• MouseUp − it occurs when the mouse pointer
is over the control and the mouse button is
released
• MouseWheel − it occurs when the mouse
wheel moves and the control has focus
• The MouseEventArgs object is used for handling
mouse events. It has the following properties −
• Buttons − indicates the mouse button pressed
• Clicks − indicates the number of clicks
• Delta − indicates the number of detents the
mouse wheel rotated
• X − indicates the x-coordinate of mouse click
• Y − indicates the y-coordinate of mouse click
Handling Keyboard Events
• Following are the various keyboard events
related with a Control class −
• KeyDown − occurs when a key is pressed
down and the control has focus
• KeyPress − occurs when a key is pressed and
the control has focus
• KeyUp − occurs when a key is released while
the control has focus
properties −
• Alt − it indicates whether the ALT key is pressed
• Control − it indicates whether the CTRL key is
pressed
• Handled − it indicates whether the event is
handled
• KeyCode − stores the keyboard code for the
event
• KeyData − stores the keyboard data for the event
• KeyValue − stores the keyboard value for the
event
• Modifiers − it indicates which modifier keys
(Ctrl, Shift, and/or Alt) are pressed
• Shift − it indicates if the Shift key is pressed
Exception Handling
• An exception is a problem that arises during
the execution of a program. An exception is a
response to an exceptional circumstance that
arises while a program is running, such as an
attempt to divide by zero.
• Exceptions provide a way to transfer control
from one part of a program to another. VB.Net
exception handling is built upon four
keywords - Try, Catch, Finally and Throw.
• Try − A Try block identifies a block of code for which
particular exceptions will be activated. It's followed by one
or more Catch blocks.
• Catch − A program catches an exception with an exception
handler at the place in a program where you want to handle
the problem. The Catch keyword indicates the catching of
an exception.
• Finally − The Finally block is used to execute a given set of
statements, whether an exception is thrown or not thrown.
For example, if you open a file, it must be closed whether
an exception is raised or not.
• Throw − A program throws an exception when a problem
shows up. This is done using a Throw keyword.
Exception Class Description
System.IO.IOException Handles I/O errors.
System.IndexOutOfRangeException Handles errors generated when a method
refers to an array index out of range.
System.ArrayTypeMismatchException Handles errors generated when type is
mismatched with the array type.
System.NullReferenceException Handles errors generated from deferencing
a null object.
System.DivideByZeroException Handles errors generated from dividing a
dividend with zero.
System.InvalidCastException Handles errors generated during
typecasting.
System.OutOfMemoryException Handles errors generated from insufficient
free memory.
System.StackOverflowException Handles errors generated from stack
overflow.

Más contenido relacionado

Similar a UNIT4.2(VB).pptx

Delphi L08 Controls at Runtime P2
Delphi L08 Controls at Runtime P2Delphi L08 Controls at Runtime P2
Delphi L08 Controls at Runtime P2
Mohammad Shaker
 
Event handling63
Event handling63Event handling63
Event handling63
myrajendra
 

Similar a UNIT4.2(VB).pptx (18)

Ajp notes-chapter-03
Ajp notes-chapter-03Ajp notes-chapter-03
Ajp notes-chapter-03
 
Asp.net event handler
Asp.net event handlerAsp.net event handler
Asp.net event handler
 
09events
09events09events
09events
 
Event handling
Event handlingEvent handling
Event handling
 
File Handling
File HandlingFile Handling
File Handling
 
Intake 38 7
Intake 38 7Intake 38 7
Intake 38 7
 
Delphi L08 Controls at Runtime P2
Delphi L08 Controls at Runtime P2Delphi L08 Controls at Runtime P2
Delphi L08 Controls at Runtime P2
 
Web technology
Web technology Web technology
Web technology
 
exception handling
exception handlingexception handling
exception handling
 
B2. activity and intent
B2. activity and intentB2. activity and intent
B2. activity and intent
 
Programming aids- Algorithm, Flowchart, Pseudocodes and Decision table
Programming aids- Algorithm, Flowchart, Pseudocodes and Decision tableProgramming aids- Algorithm, Flowchart, Pseudocodes and Decision table
Programming aids- Algorithm, Flowchart, Pseudocodes and Decision table
 
JavaScript_Events.pptx
JavaScript_Events.pptxJavaScript_Events.pptx
JavaScript_Events.pptx
 
Mobile Application Development class 005
Mobile Application Development class 005Mobile Application Development class 005
Mobile Application Development class 005
 
The touch events
The touch eventsThe touch events
The touch events
 
AJP key event class.pptx
AJP key event class.pptxAJP key event class.pptx
AJP key event class.pptx
 
Programming with C++
Programming with C++Programming with C++
Programming with C++
 
Lesson 07 Actions and Commands in WPF
Lesson 07 Actions and Commands in WPFLesson 07 Actions and Commands in WPF
Lesson 07 Actions and Commands in WPF
 
Event handling63
Event handling63Event handling63
Event handling63
 

Más de Karthik Rohan (14)

Normal-forms-for-Context-Free-Grammars.ppt
Normal-forms-for-Context-Free-Grammars.pptNormal-forms-for-Context-Free-Grammars.ppt
Normal-forms-for-Context-Free-Grammars.ppt
 
introduction to Laravel and its Basic and origin
introduction to Laravel and its Basic and originintroduction to Laravel and its Basic and origin
introduction to Laravel and its Basic and origin
 
unit-3-flip-flop-notes.pdf
unit-3-flip-flop-notes.pdfunit-3-flip-flop-notes.pdf
unit-3-flip-flop-notes.pdf
 
BSc(IoT) - Digital.pptx
BSc(IoT) - Digital.pptxBSc(IoT) - Digital.pptx
BSc(IoT) - Digital.pptx
 
Inheritance.pptx
Inheritance.pptxInheritance.pptx
Inheritance.pptx
 
Thread.pptx
Thread.pptxThread.pptx
Thread.pptx
 
SVM_Sample.pptx
SVM_Sample.pptxSVM_Sample.pptx
SVM_Sample.pptx
 
neuralnetwork.pptx
neuralnetwork.pptxneuralnetwork.pptx
neuralnetwork.pptx
 
IT Unit III.pptx
IT Unit III.pptxIT Unit III.pptx
IT Unit III.pptx
 
13598881-introduction-to-java-lecture-one.pdf
13598881-introduction-to-java-lecture-one.pdf13598881-introduction-to-java-lecture-one.pdf
13598881-introduction-to-java-lecture-one.pdf
 
Thread.pptx
Thread.pptxThread.pptx
Thread.pptx
 
AI-UNIT 1 FINAL PPT (1).pptx
AI-UNIT 1 FINAL PPT (1).pptxAI-UNIT 1 FINAL PPT (1).pptx
AI-UNIT 1 FINAL PPT (1).pptx
 
Thread.pptx
Thread.pptxThread.pptx
Thread.pptx
 
BD1.pptx
BD1.pptxBD1.pptx
BD1.pptx
 

Último

+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...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Último (20)

Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
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...
 
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, ...
 
+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...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
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
 
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
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
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
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
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
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 

UNIT4.2(VB).pptx

  • 1. Handling Mouse Events Mouse events occur with mouse movements in forms and controls. Following are the various mouse events related with a Control class − MouseDown − it occurs when a mouse button is pressed MouseEnter − it occurs when the mouse pointer enters the control MouseHover − it occurs when the mouse pointer hovers over the control MouseLeave − it occurs when the mouse pointer leaves the control MouseMove − it occurs when the mouse pointer moves over the control
  • 2. • MouseUp − it occurs when the mouse pointer is over the control and the mouse button is released • MouseWheel − it occurs when the mouse wheel moves and the control has focus
  • 3. • The MouseEventArgs object is used for handling mouse events. It has the following properties − • Buttons − indicates the mouse button pressed • Clicks − indicates the number of clicks • Delta − indicates the number of detents the mouse wheel rotated • X − indicates the x-coordinate of mouse click • Y − indicates the y-coordinate of mouse click
  • 4. Handling Keyboard Events • Following are the various keyboard events related with a Control class − • KeyDown − occurs when a key is pressed down and the control has focus • KeyPress − occurs when a key is pressed and the control has focus • KeyUp − occurs when a key is released while the control has focus
  • 5. properties − • Alt − it indicates whether the ALT key is pressed • Control − it indicates whether the CTRL key is pressed • Handled − it indicates whether the event is handled • KeyCode − stores the keyboard code for the event • KeyData − stores the keyboard data for the event
  • 6. • KeyValue − stores the keyboard value for the event • Modifiers − it indicates which modifier keys (Ctrl, Shift, and/or Alt) are pressed • Shift − it indicates if the Shift key is pressed
  • 7. Exception Handling • An exception is a problem that arises during the execution of a program. An exception is a response to an exceptional circumstance that arises while a program is running, such as an attempt to divide by zero. • Exceptions provide a way to transfer control from one part of a program to another. VB.Net exception handling is built upon four keywords - Try, Catch, Finally and Throw.
  • 8. • Try − A Try block identifies a block of code for which particular exceptions will be activated. It's followed by one or more Catch blocks. • Catch − A program catches an exception with an exception handler at the place in a program where you want to handle the problem. The Catch keyword indicates the catching of an exception. • Finally − The Finally block is used to execute a given set of statements, whether an exception is thrown or not thrown. For example, if you open a file, it must be closed whether an exception is raised or not. • Throw − A program throws an exception when a problem shows up. This is done using a Throw keyword.
  • 9. Exception Class Description System.IO.IOException Handles I/O errors. System.IndexOutOfRangeException Handles errors generated when a method refers to an array index out of range. System.ArrayTypeMismatchException Handles errors generated when type is mismatched with the array type. System.NullReferenceException Handles errors generated from deferencing a null object. System.DivideByZeroException Handles errors generated from dividing a dividend with zero. System.InvalidCastException Handles errors generated during typecasting. System.OutOfMemoryException Handles errors generated from insufficient free memory. System.StackOverflowException Handles errors generated from stack overflow.