[go: up one dir, main page]

0% found this document useful (0 votes)
8 views50 pages

Lecture 1 Chapter 1

The document provides an introduction to event-driven programming, detailing its principles, applications, and the use of languages like Visual Basic .NET and C#. It explains how event-driven systems operate based on user-triggered events and contrasts them with command-driven programming. Additionally, it covers the .NET framework and Visual Studio as tools for developing event-driven applications.

Uploaded by

bahilutesfaye719
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views50 pages

Lecture 1 Chapter 1

The document provides an introduction to event-driven programming, detailing its principles, applications, and the use of languages like Visual Basic .NET and C#. It explains how event-driven systems operate based on user-triggered events and contrasts them with command-driven programming. Additionally, it covers the .NET framework and Visual Studio as tools for developing event-driven applications.

Uploaded by

bahilutesfaye719
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 50

Event Driven Programming

(ITec3054 )

ARSI UNIVERSITY
COLLEGE OF BUSINESS AND ECONOMICS
DEPARTMENT OF INFORMATION TECHNOLOGY

Chapter one
Introduction

06/10/2025 Event-driven Programming 1


Objectives
 Course Overview

 What is an event driven system?

 What is event driven programming?

– Visual basic .NET

– .NET framework(Dot net framework)

• Visual Studio 2010

• Defining and working with :-

– Controls, properties, methods and Namespace.

• Building Your First Application

• Console applications
06/10/2025 Event-driven Programming 2
What are event driven programs?
 The logic flow of the program is controlled by events.

 What the program does depends on what evens have taken place.
 Before Defining event drive programming, we must first know what events
are?

What does Events mean ?


 The events acts as a ‘trigger’ to make the program do something.
 Events are the actions that are performed by the user during the application usage.

 Examples
• A user Clicking a mouse button or selecting a menu option.
• Moving the mouse
• Pressing a Key down/up
• Encountering messages from other programs or threads

06/10/2025 Event-driven Programming 3


4
5
6
7
8
9
Event driver programming…?
 Event driver programming is:-

– also called event-based programming.

– any programming language, which uses these events to run a specific


portion of the program.
 Other definitions

– It is a programming paradigm in which the flow of the program is


determined by events.
– Event-driven programming is an application architecture technique in
which the application has a main loop which is clearly divided into two
sections:
• the first is event selection (or event detection), and

• the second is event handling


06/10/2025 Event-driven Programming 10
Event driver programming…
• Most programs are Event Driven programs :-

– GUI operating systems such as Windows, Spreadsheets, Word

processors etc.

– Games are the biggest example of these kinds of applications.

– The GUI based programs are all developed using event driven

programming.
• The other technology used in contrast to event driver programs is command driven
programs, where using the command driven interface a user does each and every
task.
– But this programming paradigm is difficult to operate and is not user friendly.
• The commands must be remembered in order to work it possible .
06/10/2025 Event-driven Programming 11
Event driver programming…
• The event driven programs are very user friendly and highly

interactive systems.

• Event-driven programs can be written in any language, although the

task is easier in languages that provide high-level abstractions.

• The entire object based languages and visual languages supports

the event driver programming. Examples of these languages are:-


o Visual Basic,
o Visual FoxPro,
o JavaScript,
o Visual C++ ,
o visual basic.NET and
06/10/2025 Event-driven Programming 12
o Java.
C#

• C# is :-
– an object-oriented language and fully supports the object oriented

programming concepts of inheritance, polymorphism, encapsulation, and

abstraction.

– also supports component-oriented programming, which enables you to

specify units of functionality (components) that are self-contained and self

documenting by presenting a model with properties, methods, events, and

metadata about the component.

06/10/2025 Event-driven Programming 13


Types of C# Programs

 Console applications-Console applications run from the command line which

are primarily character- or text-based.

 Window forms applications-that take advantage of the graphical user

interface (GUI) provided by Microsoft Windows.

 Web Services-Web Services are routines that can be called across the Web

 Web form/ASP.NET applications-ASP.NET applications are executed on a

Web server and generate dynamic Web pages.

06/10/2025 Event-driven Programming 14


About C#
 We can use C# for developing console and
windows app.
 Can download form Microsoft as java is
downloaded from oracle.
 Microsoft premium tool for software
development.
 Programming language developed by
Microsoft since 2000.
 Similar to , and a direct competitor to Java.
 If you want to make Microsoft only applications or
work for Microsoft shops, then C# is for you.
 If you want to work in finance or other major
industry and write the big apps for big iron UNIX
servers or cross platform tools then Java is for
you.
 C# is best suitable for Windows
applications and video game
development. It is often used for web
applications and enterprise software too.
While Java performs great for web apps
and Android apps

06/10/2025 Event-driven Programming 15


Con’t….
• An integrated development environment (IDE) (also
known as integrated design environment or
integrated debugging environment) is a software
application that provides comprehensive facilities to
computer programmers for software development.
An IDE normally consists of:
 a source code editor
 a compiler and/or an interpreter
 build automation tools
 a debugger
16
Cont…
• Visual basic to is a tool that allows you to
develop window (Graphic user interface
application.
• •Visual basic is an implement of Microsoft
event-driven programming language.
• • The visual basic IDE has three distinct states:
 Design,
 Run
 and debug.
17
The IDE is composed of these parts:
 The menu bar
 The toolbar
 The Project explorer
 The Properties window
 The Form Layout window
 The toolbox
 Form designers
 Code windows
18
Visual Basic . NET

 Visual Basic . Net is one of even driven programming languages.

– It is used to develop
• windows based,
• console based and
• web based applications.
 VB.NET extends best features of VB 6.0 and consists of the following additional
features
– true object-oriented inheritance
– overloading
– free threading
– strict type checking
– elegant error handling
– a new shared development environment.
06/10/2025 Event-driven Programming 19
What is .NET framework
• The .NET framework is a software development and execution environment

designed by Microsoft as a direct competitor to Java.

• It provides a controlled programming environment where software can be

developed, installed and executed on Windows-based operating systems.


• The principal design features are:

– Interoperability: This allows for .NET-developed programs to access


functionalities in programs developed outside .NET.
– Common Runtime Engine: Also known as the common language
runtime, this allows programs developed in .NET to exhibit common
behaviors in memory usage, exception handling and security.
06/10/2025 Event-driven Programming 20
What is .NET framework
– Language Independence: Common language infrastructure
specifications (CLI) allow for the exchange of data types between two
programs developed in different languages.
– Base Class Library: A library of code for most common functions--used
by programmers to avoid repetitive rewriting of code.
– Ease of Deployment: There are tools to ensure the ease of installing
programs without interfering with previously installed applications.
– Security: Programs developed in .NET are based on a common security
model.

06/10/2025 Event-driven Programming 21


The .NET Framework

Visual Studio.NET
VB C++ C# JScript …

Common Language Specification

ASP.NET: Web Services Windows


Windows
and Web Forms Forms
Forms

ADO.NET: Data and XML

Base Class Library

Common Language Runtime

06/10/2025 Event-driven Programming 22


Visual Studio
• Visual Studio .NET is Microsoft’s Integrated Development Environment

(IDE) for creating, running and debugging programs (also called


applications) written in a variety of .NET programming languages.
• This IDE is a powerful and sophisticated tool for creating business critical
and mission-critical applications.
• Prior to beginning Visual Basic .NET installation, you should make some
preliminary checks first.
– You must verify that you meet the system requirements for installation.
(free hard disk space, RAM size and etc).
– Platform In running process actually what is happening?
06/10/2025 Event-driven Programming 23
Basic Event Driven Programming Model

06/10/2025 Event-driven Programming 24


The Main Windows of the Visual Studio IDE

06/10/2025 Event-driven Programming 25


Building Your First Application…
• You have to create a project first to work on VB.NET programming.
• To create a project you have three options once you are in main
window
– Click File  New Project
– Click on New Project button on the tool bar
– Press CTRL + New Keys
• From the window displayed choose windows Form applications
template.
– Using VB.NET different kinds of templates such as, applications or
libraries or even empty project can be created.
06/10/2025 Event-driven Programming 26
VB.NET design time environment

06/10/2025 Event-driven Programming 27


Cont.….

06/10/2025 Event-driven Programming 28


29
30
31
Visual Basic .NET Forms
• A Big square in the top left corner of the design environment is called
Form.
– All the controls for an application are assembled on forms .

06/10/2025 Event-driven Programming 32


Properties of Controls…
• Some of the properties of controls
are : Name, BackColor, Font,
Image, Text, etc.
• Just to the right of these
properties are the values for them
- These values are the default
values, and can be changed.
• The list of properties can be
displayed in a more accessible
form i.e. alphabetically or in
category.
• To display the list properties
alphabetically, click the Alphabetic
icon at the top of the Properties
box, as shown here in the diagram.

06/10/2025 Event-driven Programming 33


06/10/2025 Event-driven Programming 34
35
36
37
38
06/10/2025 Event-driven Programming 39
Methods
• A Method is a procedure built into the class.
• They are a series of statements that are
executed when called.
• Methods allow us to handle code in a simple
and organized fashion.
• There are two types of methods in VB .NET:
– those that return a value (Functions) and
– those that do not return a value (Sub Procedures).

06/10/2025 Event-driven Programming 40


Event Handling

06/10/2025 Event-driven Programming 41


42
43
44
45
46
47
48
49
50

You might also like