Visual programming Chapter 2: Events and Event Handling

Slides:



Advertisements
Similar presentations
Microsoft Expression Web-Illustrated Unit J: Creating Forms.
Advertisements

Using Eclipse. Getting Started There are three ways to create a Java project: 1:Select File > New > Project, 2 Select the arrow of the button in the upper.
11 ASP.NET Controls II Beginning ASP.NET 4.0 in C# 2010 Chapter 6.
CA 121 Intro to Programming Tariq Aziz and Kevin Jones GUI Programming in Visual Studio.NET Chapter 1 Tariq Aziz and Kevin Jones.
Compunet Corporation Programming with Visual Studio.NET GUI Week 13 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.
Fundamentals of Programming in Visual Basic 3.1 Visual basic Objects Visual Basic programs display a Windows style screen (called a form) with boxes into.
CS0004: Introduction to Programming Events. Review  Event Procedure  A set of instructions to be executed when a certain event happens.  Many event-driven.
1 Events Lect 8. 2 Event-driven Pages one popular feature of the Web is its interactive nature e.g., you click on buttons to make windows appear e.g.,
XP Tutorial 5 Buttons, Behaviors, and Sounds. XP New Perspectives on Macromedia Flash MX Buttons Interactive means that the user has some level.
Introduction to Graphical User Interfaces. Objectives * Students should understand what a procedural program is. * Students should understand what an.
Introduction to Visual Basic. Quick Links Windows Application Programming Event-Driven Application Becoming familiar with VB Control Objects Saving and.
Ethernet port  Make sure that your computer has an Ethernet connection (RJ45 port).  Power the zSeries on and make sure the “network link” LED is solid.
Basic Controls & Properties Chapter 2. Overview u VB-IDE u Basic Controls  Command Button  Label  Text Box  Picture Box u Program Editor  Setting.
Introduction to the Visual Studio.NET IDE (LAB 1 )
Intro to More Controls in C#. C# Demonstration We already touched on labels and buttons Ad-hoc demo of controls – Textboxes Multiline – Checkbox – Radiobutton.
BIL528 – Bilgisayar Programlama II Introduction 1.
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”
Controls. Adding Controls to Form -You can pick controls from the toolbox. -To add the controls from Toolbox to the Form You have be in design view. -To.
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.
1 Getting Started with C++. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Visual Studio 2008.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Second Edition by Tony Gaddis.
Class Builder Tutorial Presented By- Amit Singh & Sylendra Prasad.
1 CSC160 Chapter 7: Events and Event Handlers. 2 Outline Event and event handlers onClick event handler onMouseOver event handler onMouseOut event handler.
Forms and Controls Part 3 dbg --- Naming conventions, Button, Event handlers, Label.
Double click here to add event title Double click here to add event date Double click here to add event time Double click here to add event location.
Page 1 UPC (Universal Product Code) Inquiry By MIS Department.
Forms and Controls Part 3 dbg --- Naming conventions, Button, Event handlers, Label.
1NetBeans Tutorial Using the “Properties” menu, name the List “List1” and the button “Button1”. NetBeans Tutorial6.
Compunet Corporation Programming with Visual Basic.NET Working with Menus and Dialog Boxes Week 14 Tariq Aziz and Kevin Jones.
Lecture Set 7 Procedures and Event Handlers Part B - The Structure of an Application Event Handlers.
LESSON : EVENTS AND FORM VALIDATION -JAVASCRIPT. EVENTS CLICK.
Customizing Menus and Toolbars CHAPTER 12 Customizing Menus and Toolbars.
SCORE Sequence Choices to be made Once may not be enough Reuse and recycle Evaluate and improve.
PaintPictureBoxDemo Refers to the PaintPictureBoxDemo Visual Basic Program Included With The Lecture.
How to save the appeal form before submission Click to continue.
Microsoft Visual C# 2010 Fourth Edition Chapter 3 Using GUI Objects and the Visual Studio IDE.
Chapter 7 Multiple Forms, Modules, and Menus. Section 7.2 MODULES A module contains code—declarations and procedures—that are used by other files in a.
Chapter 8 Multiple Forms, Modules, and Menus. Introduction This chapter demonstrates how to: – Add multiple forms to a project – Create a module to hold.
Chapter 2 – Introduction to Windows Operating System II Manipulating Windows GUI 1CMPF112 Computing Skills for Engineers.
Computing with C# and the .NET Framework
Chapter Topics 15.1 Graphical User Interfaces
Chapter 2 – Introduction to the Visual Studio .NET IDE
Console and GUI Programs
Graphical User Interface Concepts: Part I
1. Introduction to Visual Basic
 Firstly you need to press the “Windows” key, and then simply enter “Google Chrome” that will bring up the search option. Here you need to right-click.
How to design a Windows Forms application
Visual programming Chapter 1: Introduction
Visual studio 2010 SENG 403, Tutorial 2 SENG Winter 2011.
MFC Dialog Application
Visual programming Chapter 3: GUI (Graphical User Interface) Part I
Event Driven Programming
Outlook and .
IM (Instant Messaging)
Simple Windows Applications
This presentation has been prepared by Vault Intelligence Limited (“Vault") and is intended for off line demonstration, presentation and educational purposes.
HOW TO CREATE A CLASS Steps:
CIS16 Application Development and Programming using Visual Basic.net
Digital Image Processing
A Guide to adding Sites and Blocks within ESTATE Manager
Chapter 15: GUI Applications & Event-Driven Programming
Constructors, GUI’s(Using Swing) and ActionListner
European Computer Driving Licence
This presentation has been prepared by Vault Intelligence Limited (“Vault") and is intended for off line demonstration, presentation and educational purposes.
Chapter 13: Handling Events
GUI Programming in Visual Studio .NET
Executive Reports, Instructions and Documentation
Presentation transcript:

Visual programming Chapter 2: Events and Event Handling Eman Alnaji Dareen Hamoudeh

Contents What is an Event? What is an Event Handler? What is the default event and how to create an event handler for it? How to create an Event Handler other than the default? How to call the same Event Handler by different controls?

What is an Event? An event is an action done by the user, or by the program itself, during the runtime of the project. Example: When a user clicks a button. When a user checks a checkbox. When the user moves the mouse over the form. Sometimes you need to relate these events with certain action(s) in your project. Example: when the button is clicked  close the form. Here, you will need to create an Event Handler.

What is an Event Handler? An Event Handler, is a Method created in your code, but is attached to the control and event you need, so that whenever the event takes place the Method will be called and executed. Important Note: You don’t need to call the Event Handler explicitly, all you need is to relate it to a certain event and this event will call it.

What is the default event? And how to create an Event Handler for it? Each control has a default event, which is the common event that a user is familiar with. Example: When a user sees a button on the form, he/she will anticipate that this button should be clicked, so the default event for a button is click. So how to create an Event Handler for a default event? Simply, by doubleclick on the control at design area, and a new method (event handler) will be created in the code file, and connected to this control and event.

What is the default event? And how to create an Event Handler for it? Suppose you have a button1 in your form. Double click on the button, and check the code in form1.cs. Note here that the event handler is named after both the control and the event button1_Click

What is the default event? And how to create an Event Handler for it? How to relate this function to this event, surely the name is not enough. In the Properties window, click on the Events Icon This icon will display all the possible events for the selected control. (form also has its own events). Check here, the name of the event handler button1_Click is displayed next to event Click. This connection is created as soon as you double clicked on the button, and the event handler was created and connected directly.

What is the default event? And how to create an Event Handler for it? Now you can add the code you need to be executed when this button is clicked.

How to create an Event Handler other than the default? Suppose you need to activate another event on the button other than the default (click). For example, you need to activate the (Enter) event. All you need to do is go the Properties Window, and click on the Events button, and search for the (Event) event. Then, you either double click on it, or press enter.

How to create an Event Handler other than the default? This simple action, will create the event handler in the code and connect it directly with the button and the Enter event.

How to call the same Event Handler by different controls? Sometimes, you need to repeat the same code in several controls. For example, you need to create 2 buttons, and both of them should close the form. So, all you need is to create the event handler (button1_Click) for button1, and write the needed code in it. Then, point to this event handler by button2, via the Properties Window. Here select the needed event handler

The End