HARAMAYA UNIVERSITY
COLLEGE OF COMPUTING AND INFORMATICS
DEPARTMENT OF SOFTWARE ENGINEERING
EVENT-DRIVEN PROGRAMMING (Seng 5121)
CHAPTER FIVE- WINDOWS FORM BASICS
COMPILED BY: GIZACHEW B.
2 CONTENTS
How to Create Windows Form Application
Tool Overview
Common Controls
Exercise | Form Development
3
CREATE WINDOWS FORM APPLICATION … (1)
C# WINDOWS
FORMS APP
CREATE A NEW GIVE PROJECT
PROJECT NAME
DEFAULT FORM1
WINDOW
OPEN VS 2022
4
CREATE WINDOWS FORM APPLICATION … (2)
CREATE A NEW PROJECT C# WINDOWS FORMS APP
5
CREATE WINDOWS FORM APPLICATION … (3)
GIVE PROJECT NAME DEFAULT FORM1 WINDOW
6
TOOL OVREVIEW
SOLUTION EXPLORER
PROPERTIES
7
TOOL OVREVIEW … SOLUTION EXPLORER
Visual Studio provides a Solution Explorer window that enables you to
explore and manage your solutions and projects.
By default, the Solution Explorer tool window appears as a pane in the
upper-right side of the Visual Studio.
If you don't see the Solution Explorer tool window, you can open it from
the Visual Studio menu bar by using View > Solution Explorer.
Solution Explorer displays the projects that form your solution, the files
and folders in a project as they appear on the physical hard drive, and
any assemblies, COM objects or files the project references.
The context menus within Solution Explorer provide a variety of
commands that help you manage your projects.
8
TOOL OVREVIEW … PROPERTIES WINDOW
The Properties window displays the properties of single or
multiple selected items.
If multiple items are selected, the intersection of all properties for
all selected objects is displayed.
Use this window to view and change the design-time properties and
events of selected objects that are located in editors and designers.
You can also use the Properties window to edit and view file,
project, and solution properties.
You can find Properties Window on the View menu.
The Properties window displays different types of editing fields,
depending on the needs of a particular property.
9
COMMON CONTROLS… (1)
Toolbox that contains the whole control elements
10
COMMON CONTROLS… (2)
FOCUS AREA = YELLOW RECTANGLE
CONTROL NAME = LABEL
Used to display Text to user that
can not be directly Edited.
FOCUS AREA = RED RECTANGLE
CONTROL NAME = LINKLABEL
Display Text as a Web-Style link and
triggers an event when the user clicks
11
COMMON CONTROLS… (3)
FOCUS AREA = YELLOW RECTANGLE
CONTROL NAME = TEXTBOX
Displays text entered at design time
that can be edited by users at runtime,
or changed programmatically.
FOCUS AREA = RED RECTANGLE
CONTROL NAME = RICHTTEXTBOX
Enable text to be displayed with
formatting in plain text or Rich Text
Format(RTF).
12
COMMON CONTROLS… (4)
FOCUS AREA = YELLOW RECTANGLE
CONTROL NAME = RADIOBUTTON
Display a button that can be turned on
or off. Used to select when we want a
user to select only single option.
FOCUS AREA = RED RECTANGLE
CONTROL NAME = CHECKBOX
Used to set options. Unlike radio button,
checkbox used when we want a user to
select more than one option.
13
COMMON CONTROLS… (5)
FOCUS AREA = YELLOW RECTANGLE
CONTROL NAME = BUTTON
Used to start, stop, and interrupt
process; used to process click event
FOCUS AREA = RED RECTANGLE
CONTROL NAME = COMBOBOX
Allows the user to select an item from a
drop-down box.
14
COMMON CONTROLS… (6)
FOCUS AREA = YELLOW RECTANGLE
CONTROL NAME = PICTUREBOX
Allows you to display a graphic or
picture.
FOCUS AREA = RED RECTANGLE
CONTROL NAME = DATETIMEPICKER
Allows the user to select a specific
date and/or time.
15
EXERCISE
DEVELOP THE FOLLOWING FORMS
1
16
EXERCISE
DEVELOP THE FOLLOWING FORMS
2
TEACHING YOU IS GOOD LUCK