Delphi Programming Tutorial – Unit 8.1. Understanding Events and Event Handlers in Delphi

Learn Delphi Programming – Unit 8.1. Understanding Events and Event Handlers in Delphi:

Many beginner programmers visualize a Delphi project as a graphical user interface with a unit file that consists of a series of procedures that execute in a sequence. In reality, most programs are event driven – meaning the flow of execution is determined by external occurrences called events.

An event is a signal that informs an application that something important was triggered. An example of this is when a user clicks a button on a form. An OnClick event is triggered and a procedure is called that handles the event. This procedure is known as the event handler for the OnClick event.

Event handlers are procedures that are called when a corresponding event occurs. You can use any valid subroutine/procedure with a matching signature/procedure header as an event handler.

Delphi uses a standard naming convention for event handlers that combines the name of the event sender (the object i.e. btnDisplay) and the name of the event (excluding the “On” prefix). An example of this is the event handler for the OnClick event of a button named btnDisplay that would be named btnDisplayClick.

Events can also allow separate tasks to interact. Let’s assume that your program performs a background task, like downloading a file, separately from the main application or process. If a user cancels the download, your application can send a cancel event instructing the download process to stop.

Delphi objects can respond to more than one event. However, an object only has one default event. All the other events are known as the object’s additional events. Each event is associated with its own event handler.

In this tutorial we look at events and event handler. You will see examples of default and additional events for different Delphi objects and how to associate them with their event handlers.

Best viewed in HD. To change your settings to HD:

1. Click on the Gear-icon (Settings) at the bottom of the YouTube Video Player.

2. Select “720p HD” and wait a few moments for the setting to take effect.

Enjoy!

For more Delphi video tutorials also join us at https://www.learndelphi.net.

You may also want to visit the following resources for more information:

https://cc.embarcadero.com
https://www.lazarus-ide.org
https://www.planet-source-code.com
https://www.delphi.about.com
https://www.embarcadero.com
https://www.edn.embarcadero.com
http://techteachers.co.za
http://www.studyopportunities.co.za
https://www.facebook.com/DelphiSchools
http://www.lazarus-ide.org/
http://www.delphibasics.co.uk http://stackoverflow.com/

Comments

Muhammad Shahrizal says:

Good video tutorial for beginner like me. I am liking it so far.Clear and Easy to understand. Thank you so much

Write a comment

*

Human Verification: In order to verify that you are a human and not a spam bot, please enter the answer into the following box below based on the instructions contained in the graphic.


Do you like our videos?
Do you want to see more like that?

Please click below to support us on Facebook!

Send this to a friend

▷ Other ReviewsVehicles▷ Show Cars▷ Motorbikes▷ Scooters▷ Bicycles▷ Rims & Tires▷ Luxury BoatsFashion▷ Sunglasses▷ Luxury Watches▷ Luxury Purses▷ Jeans Wear▷ High Heels▷ Kinis Swimwear▷ Perfumes▷ Jewellery▷ Cosmetics▷ Shaving Helpers▷ Fashion HatsFooding▷ Chef Club▷ Fooding Helpers▷ Coktails & LiquorsSports▷ Sport Shoes▷ Fitness & Detox▷ Golf Gear▷ Racquets▷ Hiking & Trek Gear▷ Diving Equipment▷ Ski Gear▷ Snowboards▷ Surf Boards▷ Rollers & SkatesEntertainment▷ DIY Guides▷ Zik Instruments▷ Published Books▷ Music Albums▷ Cine Movies▷ Trading Helpers▷ Make Money▷ Fishing Equipment▷ Paintball Supplies▷ Trading Card Games▷ Telescopes▷ Knives▷ VapesHigh Tech▷ Flat Screens▷ Tech Devices▷ Camera Lenses▷ Audio HiFi▷ Printers▷ USB Devices▷ PC Hardware▷ Network Gear▷ Cloud Servers▷ Software Helpers▷ Programmer Helpers▷ Mobile Apps▷ Hearing AidsHome▷ Home Furniture▷ Home Appliances▷ Tools Workshop▷ Beddings▷ Floor Layings▷ Barbecues▷ Aquarium Gear▷ Safe Boxes▷ Office Supplies▷ Security Locks▷ Cleaning ProductsKids▷ Baby Strollers▷ Child Car Seats▷ Remote ControlledTravel▷ Luggages & Bags▷ Airlines Seats▷ Hotel Rooms▷ Fun Trips▷ Cruise Ships▷ Mexico Tours